Questions tagged [laravel-6]

Laravel 6.0 is a past main version of the open-source PHP web framework created by Taylor Otwell. It was released on September 3, 2019. Use the [laravel] tag for general Laravel related questions.

Laravel 6.0 (LTS) continues the improvements made in Laravel 5.8 by introducing semantic versioning, compatibility with Laravel Vapor, improved authorization responses, job middleware, lazy collections, sub-query improvements, the extraction of frontend scaffolding to the laravel/ui Composer package, and a variety of other bug fixes and usability improvements.

What is new:

  • Semantic Versioning
  • Laravel Vapor Compatibility
  • Improved Exceptions Via Ignition
  • Improved Authorization Responses
  • Job Middleware
  • Lazy Collections
  • Eloquent Subquery Enhancements
  • Laravel UI

Resources:

1918 questions
11
votes
2 answers

Loading last record of hasMany relationship

I have the following code in my controller where I am trying to load all 'members'. Every member can have more than one phone number. Phone numbers are stored in a table called phone_numbers and are tied to user id's. Below, I am trying to load the…
AnchovyLegend
  • 12,139
  • 38
  • 147
  • 231
11
votes
6 answers

How can I use auth for custom guard in my package using laravel 6?

I am trying to make auth through laravel package using admins table. In the project directory I added admin guard into config/auth.php 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, …
Imran Abbas
  • 755
  • 1
  • 7
  • 24
10
votes
6 answers

Laravel 6-7 How Can I Override/Change a Vendor Class?

I recently ran into a problem where I need to change one of Laravel's vendor files to get a desired result. That file is vendor/laravel/framework/Illuminate/Routing/CompileRouteCollection.php. Inside that file, a function needs to be…
Tyler Shannon
  • 279
  • 1
  • 4
  • 16
10
votes
5 answers

Trying to access array offset on value of type null when using RefreshDatabase in Laravel

I am writing tests in a fresh installation of Laravel 6.15 (with Spark 9). My PHP version is PHP 7.4.2. My testing environment is Laravel Valet on MacOS. I am facing an issue where whenever I use the RefreshDatabase trait as part of a test, all…
Rory
  • 2,175
  • 1
  • 27
  • 37
10
votes
5 answers

Laravel 6.0.3 Not Loading Key Resources App.js or App.css 404 Not Found

To setup my project I ran: laravel new cms composer require laravel/ui php artisan ui:auth php artisan migrate However, when I go to http://cms.test/login I am shown the login page: And get two 404 errors for missing…
Jack Robson
  • 2,184
  • 4
  • 27
  • 50
9
votes
2 answers

Update multiple rows at once Laravel Eloquent

I have the table products with the following structure. id | name | promote Where the column promote is of boolean type. I want to set the value of the boolean column to 1 with the selected rows and set 0 to non-selected rows. I have the following…
psudo
  • 1,341
  • 3
  • 24
  • 69
9
votes
6 answers

How to logout with a GET request in Laravel

I am getting error when i am logout, it's showing me this error..."The GET method is not supported for this route. Supported methods: POST." Please help me to solve this issue.. Here are my code... @if(Auth::check())
  • sumit group3
    • 91
    • 1
    • 1
    • 7
    9
    votes
    2 answers

    ConfirmPasswordController doesn't exist after upgrade from Laravel 5.8 to 6.2

    I am working on a project which is in Laravel 5.8, and recently, I upgraded it to Laravel 6.0 with its packages dependencies versions too. The project was running fine. But, today, I update the composer via composer update, and it upgraded to…
    Rashed Hasan
    • 3,721
    • 11
    • 40
    • 82
    9
    votes
    3 answers

    Laravel Telescope Failed to open stream: no such file or directory TelescopeServiceProvider.php

    I am trying to use the Telescope package from Laravels official documentation and I followed the first 2 steps: composer require laravel/telescope and php artisan telescope:install Everything went fine in my command line untill the install. I got…
    Loko
    • 6,539
    • 14
    • 50
    • 78
    8
    votes
    3 answers

    Laravel relationship conflicts in union

    I have following model: 1- User model /** * Define user and functional area relationship */ public function functionalAreas() { return $this->belongsToMany('App\FunctionalArea', 'user_functional_areas', 'user_id',…
    jones
    • 1,423
    • 3
    • 35
    • 76
    8
    votes
    3 answers

    Why does Cache::lock() return false in Laravel 7?

    My framework is Laravel 7 and the Cache driver is Memcached. I want to perform atomic cache get/edit/put. For that I use Cache::lock() but it doesn't seem to work. The $lock->get() returns false (see below). How can I resolve this? Fort testing, I…
    horse
    • 707
    • 4
    • 11
    • 30
    8
    votes
    3 answers

    Where to add parameter to Route: verification.notice {language}/email/verify

    Missing required parameters for [Route: verification.notice] [URI: {language}/email/verify] I added the laravel email verification to my project, after using localization. But now I have the problem that the Route: verification.notice is missing a…
    8
    votes
    4 answers

    Command "make:auth" is not defined laravel 6

    I am using Laravel 6.2.0 and command make:auth is not defined in my terminal. Is there any solution to that? Noted that Composer has already been updated.
    Mostafabd
    • 79
    • 2
    • 4
    7
    votes
    3 answers

    Laravel - Load different .env file

    I need to load a different .env file, named .env.test under certain conditions. I attempted to do that through a middleware by adding app()->loadEnvironmentFrom('.env.test'); Dotenv::create(base_path(), '.env.test')->overload(); to the bootstrap()…
    TheNiceGuy
    • 3,462
    • 8
    • 34
    • 64
    7
    votes
    2 answers

    What is the difference between a JsonResource & ResourceCollection? in Laravel v6 or v7

    Can someone explain the difference between a ResourceCollection and JsonResource? In Laravel 6 docs you can generate 2 different types of resources... ResourceCollection and JsonResource.…
    Bel
    • 75
    • 1
    • 9