Questions tagged [laravel-5.7]

Laravel 5.7 is the previous stable version of the open-source PHP web framework created by Taylor Otwell. It was released on September 4, 2018. Use it in addition to the [laravel-5] tag if your question is specific to Laravel 5.7. Use the [laravel] tag for general Laravel related questions.

Laravel 5.7 is the previous stable version of Laravel 5. It was released on September 4, 2018.

What is new:

  • Email Verification
  • Guest User Gates / Policies
  • Symfony Dump Server
  • Notification Localization
  • Console Testing
  • URL Generator & Callable Syntax
  • Paginator Links
  • Filesystem Read / Write Streams

Resources:

1390 questions
0
votes
1 answer

Adding items into array Laravel using for loop

I am trying to get all categories that have products from the database and push them into another array. I have four 3 categories and two of them have products. Here is my code: $categories = Category::all(); $count =…
Patrick Obafemi
  • 908
  • 2
  • 20
  • 42
0
votes
2 answers

Laravel 5.7 - How to use models & controllers in a custom PHP project?

I have a laravel install, setup as a new CMS. The frontend of the site is a pretty complex old website. The new CMS is going to take over a portion of it, but migrating everything to Laravel isn't an option. I understand that I can use…
Lex
  • 113
  • 9
0
votes
1 answer

Right way to select not empty values in a json column with Laravel > 5.6?

I can't seem to able to wrap my head around this. I got several translations in a json column called text, and I want to select only those records that have not empty translations for a specific language (not set, or not null). I struggle in…
Aleksandar
  • 1,496
  • 1
  • 18
  • 35
0
votes
2 answers

Upgrading to laravel 5.7 giving error in npm install or update?

After upgrading from laravel 5.6 to 5.7, running npm install or npm update is giving the following error: npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated…
Raj
  • 1,928
  • 3
  • 29
  • 53
0
votes
0 answers

laravel 5.7 login procedure issue

I have been trying to figure out why is this happening ! I have used the laravel's built in authentication method ,my laravel version is 5.7 and DB is Mysql.The problem is that when I try to login , there is no reaction performed by the server ,…
AliMahdavi
  • 109
  • 2
  • 10
0
votes
1 answer

Laravel - There is any way to get all running middlewares?

I wonder if there is any way in Laravel to get all running middlewares in a route. For example: - I want to know in route "/example", if I can easily check which are all involved Middlewares that are called. Thanks!
Facundo Fasciolo
  • 452
  • 4
  • 15
0
votes
2 answers

Laravel 5.7: Phpunit error - call to a member function getBag() on a string

I'm testing saving data into the database. When missing required fields I throw an exception and then redirect from my controller: try { $product = Product::create([ 'name' => $request->name, 'description'…
MrCujo
  • 1,218
  • 3
  • 31
  • 56
0
votes
1 answer

Why queue still waiting when send mail in laravel?

i want send mail in queue and have not waiting when send mail https://laravel.com/docs/5.7/queues#connections-vs-queues i run command to create table jobs: php artisan queue:table php artisan migrate I create a job to send mail: php artisan…
D T
  • 3,522
  • 7
  • 45
  • 89
0
votes
1 answer

How can I iterate over an array of collections containing arrays in Laravel?

My collection is instantiated using the following query: $ClassesCollection = Classes::with('Queue')->whereIn('user_course_id', UserCourse::select('id')->where('user_id', $user->id))->get(); $ClassesCollection returns the desired result. However, I…
0
votes
1 answer

How can I eager load on 3 different relationships in Laravel?

I have 4 tables: user, user_course, classes, and queues. user_course has a user_id, classes has a user_course_id, and queues has a classes_id column. I'd like to retrieve all queues with a class_id that corresponds to a user_course registered by the…
Wessam
  • 17
  • 9
0
votes
1 answer

Route issue in Laravel 5.7.2

I have just downloaded Laravel 5.7.2 project and found an issue below. Below line does not work in Laravel 5.7.2 and gives 404 Route::get('/login', array( 'uses' => 'Annonymous\Web\Auth\Login\LoginController@showLoginForm', …
Abcdef
  • 43
  • 7
0
votes
0 answers

Laravel 5.7 redirect back with() message

Trying to redirect to the previous page with message when user doesn't have enough balance. Controller: if ($balance[0] > $kitap_baha[0]) { $userkitap = new UlanyjyKitap(); $userkitap->user_id = Auth::id(); $userkitap->yarysh_id = $id; …
Maksat
  • 311
  • 5
  • 24
-1
votes
2 answers

Route not found in Laravel even it exists

I am trying to run an api on postman, I am getting the following error: Method not found I created the controller and its route using laravel 5.7, I also checked whether the route exists using php artisan route:list command! I can get the route…
-1
votes
1 answer

laravel guest middleware is redirecting to login page problem

Here are my routes in web.php Route::get('/', function () { return view('web.index'); })->name('index'); Route::get('/shop', 'WebController@index'); Route::get('/product/detail/{id?}', 'WebController@detail'); // Authentication…
-1
votes
1 answer

React has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header

According to this answers enable cors in .htaccess I would like to allow cross-origin requests from React application to the local server with Laravel application. So I added these lines at the beginning of my public/.htaccess. But it does not…
Čamo
  • 3,863
  • 13
  • 62
  • 114