Questions tagged [laravel]

Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony. The source code of Laravel is hosted on GitHub and licensed under the terms of MIT License.

0
votes
1answer
12 views

If file upload then validation chack or need not validation >> Laravel validation

Only validation check if file upload. (file exist) if not upload file then need not check validation (In laravel validation)
0
votes
0answers
10 views

How to make admin approve user in ionic 3?

There are three user roles for my current ionic apps. First is customer, clinic, and doctor. What I want to do now is I want the doctor to be able to register for the clinic. Which mean, which clinic ...
0
votes
0answers
5 views

Root issues or htaccess configuration issues?

Before deploying the laravel project into production, the laravel project works fine with docker utilization on testing environment which runs on php,mysql,nginx webserver. Just by configuring the ...
1
vote
0answers
14 views

I keep getting “error”: “Unauthenticated.” even though I added the bearer token

I'm using a laravel project and whenever I hit any of the apis that use auth:api middlewares, I get "error": "Unauthenticated.". Even though I had the bearer token added. I tried adding the token to ...
1
vote
0answers
14 views

Laravel 5.8 email verification - But forced the user to be logged

I am new to Laravel and I have come across an issue and I hope you can help me with it. I have enabled email verification in laravel so that the new users are forwarded to the standard verify email ...
0
votes
0answers
17 views

i want to get image from public folder in laravel inside blankURL : 'public/assets/images/blank.gif', in this path

$(document).ready(function() { $('.zoomple').zoomple({ // specifies the source for the blank image. blankURL : 'public/assets/images/blank.gif', // background color bgColor : '#90D5D9', // ...
0
votes
1answer
19 views

how to add auto generated alphanumeric key in id_column

What happens is a user comes on site, fills create a new product form with title, description, price et cetera fields... I want to store a unique generated alphanumeric key in my 'id' column which is ...
0
votes
0answers
13 views

I am trying to open Nova and getting directories instead of welcome page

I have set-up a Laravel-Nova project. And when i try to open this URL (htttps://localhost/81/App/nova) it opens up this folders directory instead of opening nova/login page. I have followed all the ...
0
votes
0answers
7 views

how to lookup in an embedded doc and that embedded doc have an id using mongodb

I'm using mongoDb in my project, and I have problem using lookup on embedded data.. I searched for my problem and read similar codes.. but they didn't help my problem.. I mean in my embed document ...
0
votes
1answer
25 views

laravel new project not running still loading in browser

installing laravel new project composer create-project --prefer-dist laravel/laravel newProject Project running perfect in http://localhost:8000/ in this port after some time page loading stil ...
0
votes
0answers
15 views

How to remove @charset in the CSS file when running npm?

I'm using Laravel 5.7 and i'm applying AMP to our website. (https://amp.dev/). I'm folowing these steps to convert HTML to AMP: https://amp.dev/documentation/guides-and-tutorials/start/converting/?...
0
votes
0answers
21 views

Override a vendor class which is not directly called - Laravel

I have two classes namely class A and class B of a package. Class B is injected into class A's constructor through dependency injection. I need to override a function in class B. I have below code ...
0
votes
2answers
29 views

How can I use middleware so a user has to fill in a password before viewing a page/file?

For a website I'm building I need to password protect PDF files, for this I want to use middleware so everyone that wants to go to the route of the file will be redirected to a page where they'll have ...
0
votes
0answers
10 views

A problem switching between locales and stuck on one locale and don't change

I am using mcamara/laravel-localization for a website and it's working fine on desktop but when i open the website on my sony mobile phone after switching to en it stuck on en and won't change the ...
1
vote
4answers
58 views

Merge two array elements in new one

I have two array. $a = ['0' => 1, '1' => 2, '2' => 3] $b = ['0' => 4, '1' => 5, '2' => 6] i want to create new array like this $c = [['a' => 1, 'b' => '4'], ['a' => '2'...
0
votes
1answer
20 views

Laravel: Show message(alert) on all open tabs, if session variable changed

Laravel Version: 5.2.45 PHP Version: ^5.4 I have a session variable named f_year. It stores the financial year in the session. This can be changed by the user. On changing the f_year, the session is ...
0
votes
4answers
32 views

Display dropdown list user as a first result based on URL ID along with the other users

I have a dropdown with list of users and i need to know how to display the username based on url id as a first result along with the other users https://my.space/profiel/50 $user = User::where('...
0
votes
0answers
25 views

can I get cart content directly in order repository?

I'm dealing with design patterns and I found this piece of code from here: /** * Create the order * * @param array $params * @return Order * @throws ...
0
votes
1answer
46 views

VerifyCsrfToken, Auth & Trying to get property of non-object

I'm going back to an old project, and the homepage need to be access when logged in, if not, you get redirected to /login. For that I'm using the Auth middleware, but when doing so, I get the ...
3
votes
3answers
46 views

Group By using Eloquent (Laravel)

enter image description hereThe Problem occur when I add group by in my query... Form::select('*')->groupBy('serial_num')->orderBy('id')->Paginate(10); SQLSTATE[42000]: Syntax error or ...
0
votes
1answer
24 views

How to Inverse the Eloquent Has One and Has Many Through (laravel 5.8)?

I have three relational table attached below. https://drive.google.com/file/d/1q1kdURIwFXxHb2MgdRyBkE1e3DMug7r-/view?usp=sharing I have also three separate models where defined relation among all of ...
0
votes
1answer
20 views

PHPUnit is running super slow

Typically my test suite works well. But today, when I run phpunit, I got this. It takes minutes for one test case to run, while typically it takes like 10 seconds.
0
votes
0answers
11 views

Registration using Cartalyst Sentinel in Laravel app

So basicaly i want to implement registration function using sentinel library in my laravel app. I've been following official documentation and when i tried to store the data, i facing some error like ...
0
votes
0answers
20 views

Laravel 5.8 public folder redirecting to “Index of /” page

I just moved my laravel project to my subdomain http://1hpold.kairedesu.com/ Yet, it keeps showing an "Index of /" page instead of my Laravel view. I configured my .htaccess file in my public ...
0
votes
0answers
18 views

how to find $id based on detaol siswa then saved into database

i want to save into table "penyakit" siswa_id based on detail siswa on siswa_id in URL,, URL siswa is like this siswa_id is 225 from table siswa this is my function, public function simpanData(...
1
vote
2answers
21 views

Laravel ViewServiceProvide does not takes multiple views

My Laravel version is 5.8.23 According to the documentation on Laravel View Composer, in order to attach a view composer to multiple views at once, pass the views in an array inside the first ...
1
vote
0answers
31 views

Laravel API return 401

I am working on mobile app and I connected my app to server through API now every time I try to do actions that requires users authentication I get 401 error while same action with postman do the job ...
1
vote
1answer
40 views

Fetch data from database using Ajax/jQuery in Laravel

I want to fetch data (longitude/latitude) from database and return it to draw multiple marker on Google Map using Ajax call. Below is javascript including ajax : <script type='text/javascript'>...
1
vote
1answer
27 views

Cant populate dataset from database using ConsoleTV's chart package in laravel 5.5

why i cant populate data set from my database? I can render the chart but there is no data shown. But when i use the "dd" command in laravel it shows me the array of the data. Help would be ...
0
votes
3answers
21 views

Is there a proper path for storing images (Theme and Uploads) in Laravel?

I'm relatively new to Laravel - building a basic website with it - and I'm unclear as to where I'm suppose to store images. My instinct said /resources/images but that path doesn't exist like /js and ...
0
votes
3answers
25 views

Anonymous function vs String literal contrroler in Laravel

What is difference between the fellowing two route codes? One is without controller ans seccond one has a controller: Version 1 Route::get('/', function () { return view('front/index'); }) ...
0
votes
1answer
30 views

login autorization error getting Undefined variable: erros

I'm start learning laravel and want to create sample login authorization system on my html template. I watched a tutorial and when i do everything that was in video i get error Undefined variable: ...
1
vote
2answers
35 views

laravel field with no default value

i have a small problem here and it is that the image field doesn't have a default value as the complier said but actually i assigned a value for it i know that this error pops up when the field should ...
0
votes
0answers
19 views

Laravel Echo Server command always not found

I already install laravel-echo-server globally using npm -g but when I'm going to root directory of my project, my terminal always showing me this error. it said that laravel-echo-server start is ...
0
votes
1answer
17 views

Vue Router + Laravel: Reloading a page without a 404 and passing in a route varable

When reloading my single page application, I would like the url to load correctly instead of throwing a 404 error. Using Laravel 5.6, Vue.js 2.6, & MAMP. I have tried the following code, however, ...
0
votes
1answer
24 views

Eloquent Get higher value of a specific table's column

Using Eloquent in Laravel, To get the minimum value of a column this code works: public function getLowestYearBook() { return CV_Outputs::min('book_publication_year'); } But to get the higher ...
0
votes
1answer
21 views

my delete query is not working in laravel

I am trying delete database data in Laravel. but this is not working my way. my view page is {{url('/deleteReview/'.$Review->id)}} my web is Route::post('/deleteReview/{id}','[email protected]
0
votes
1answer
37 views

how insert data json into database laravel?

I use ajax to get data json and send it to my controller, now I want to insert this data into table pointages help me please wher is the error. here is ajax code: he give me this error $('.add-all')...
1
vote
1answer
29 views

pass checkbox value from one blade to another in laravel

I have multiple pop-ups in test.blade.php where each popup has a number of checkboxes. I am trying to fetch the value of the checked box and show it in a new view named brief. But brief.blade.php isn'...
2
votes
2answers
29 views

Polymorphic relationships vs separate tables per type

I am working on a database which has some types (e.g. User, Appointment, Task etc.) which can have zero or more Notes associated with each type. The possible solutions I have come across for ...
-3
votes
1answer
32 views

404, Sorry, the page you are looking for could not be found. Laravel 5.7 [on hold]

I was working on a website using the laravel framework a while back, I got busy with other things so I left it alone. I wanted to continue it now. When I arrive at the home page and I click on the ...
0
votes
1answer
27 views

I need an http Post for this site

I have for many Days i could not make http post request for the following site http://www.imei.sy/imei I don't know the principle behind that. I tried to make the request using GuzzleHttp, and curl. ...
0
votes
1answer
34 views

Sql Query in laravel

i have two tables, products table and its photos table. I want to query products with one of their photo. my below sql query give me the result but in laravel i don't know how to use functions to take ...
0
votes
1answer
26 views

How to skip first row when importing file

I'm trying to import an .xlsx file in Laravel version 5.7 using Maatwebsite-excel version 3.1. What I want to achieve is to skip the first row of the file to avoid importing column headers in my ...
0
votes
0answers
10 views

Classic editor does not functional

I'm trying to include CKEditor5 in my code, following their official docs at https://ckeditor.com/docs/ckeditor5/latest/builds/guides/quick-start.html exactly. And yeah, it is shown up but the UI ...
0
votes
1answer
29 views

How to insert data json in database laravel?

I use a jquery and ajax to get data json and send it to my controller, now I want to insert this data into table pointages help me please. here is jquery ajax code: $('.add-all').on('click', ...
0
votes
3answers
25 views

How to show validation errors in laravel api while having a form request file separate from controller

I have a form request file handling my validations separate from my controller. How do i return validation errors after an api call within the controller? //my controller /** * Display a listing of ...
1
vote
0answers
38 views

compact(): Undefined variable: operator

i'm getting error (1/1) ErrorException compact(): Undefined variable: operator for my Line of code Here $postsCat = Post::whereHas('Cat',function($query) use ($sreachWord){ ...
1
vote
2answers
49 views

How to display image using Laravel 5.8?

I am trying to display image stored in my local. Those file uploaded are in Storage folder I am using the follow code to display the image @foreach($publications as $p) <div class="card" ...
1
vote
0answers
14 views

Laravel - testing unique cookies creation in middlewares

I have a middleware that creates cookies for guest users and I'm struggling to test it. This is my middleware's handle function: public function handle($request, Closure $next) { $guestCookieKey = '...