Questions tagged [laravel-5]

Laravel 5 is a version of Laravel released between 2015 and 2020. Laravel is a an open-source PHP web development MVC framework created by Taylor Otwell which helps you create applications using simple, expressive syntax. Use the laravel tag for general Laravel related questions.

Laravel 5.0 was released on 4th February 2015, and Laravel 5.8 in 2019. Both Laravel 5.8 and Laravel 5.5 LTS received their last security patch in 2020.

Laravel 5 uses the latest components and techniques of Design patterns and 's components. Laravel uses Composer for managing dependencies. Laravel has its own optional templating engine called Blade.

Make sure you have the following minimum PHP version for each Laravel version.

5.0 requires >= 5.4

5.1 and 5.2 requires >= 5.5.9

5.3 and 5.4 requires >= 5.6.4

5.5 requires >= 7.0.0

5.6, 5.7, and 5.8 requires >= 7.1.3

Laravel Versions

5.8 - Changelog

5.7 - Changelog

5.6 - Changelog

5.5 LTS - Changelog

5.4 - Changelog

5.3 - Changelog

5.2 - Changelog

5.1 LTS - Changelog

5.0 - Changelog

Useful documentation

Pros

  1. It uses a blade template that is fast and maintains a cache
  2. Expressive syntax
  3. Reusability of code
  4. Laravel 5.5 is the latest LTS release; Laravel 5.1 was the first LTS release

Useful Tags

Other resources

43708 questions
484
votes
28 answers

Rollback one specific migration in Laravel

I want to rollback only : Rolled back: 2015_05_15_195423_alter_table_web_directories I run php artisan migrate:rollback, 3 of my migration are rolling back. Rolled back: 2015_05_15_195423_alter_table_web_directories Rolled back:…
code-8
  • 54,650
  • 106
  • 352
  • 604
413
votes
22 answers

How to set up file permissions for Laravel?

I'm using Apache Web Server that has the owner set to _www:_www. I never know what is the best practice with file permissions, for example when I create new Laravel 5 project. Laravel 5 requires /storage folder to be writable. I found plenty of…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
410
votes
27 answers

No Application Encryption Key Has Been Specified

I'm trying to use the Artisan command like this: php artisan serve It displays: Laravel development server started: http://127.0.0.1:8000 However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this…
Carlos F
  • 4,621
  • 3
  • 12
  • 19
401
votes
33 answers

Laravel Checking If a Record Exists

I am new to Laravel. How do I find if a record exists? $user = User::where('email', '=', Input::get('email')); What can I do here to see if $user has a record?
Ben
  • 5,627
  • 9
  • 35
  • 49
400
votes
30 answers

Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

I have recently installed Laravel 5 via Composer. I tried creating a new controller using Artisan and got the following error. Am I missing something? bootstrap/../vendor/autoload.php. Failed to open stream: No such file or directory. The "vendor"…
Scott
  • 5,074
  • 3
  • 16
  • 13
324
votes
15 answers

Laravel 5 - artisan seed [ReflectionException] Class SongsTableSeeder does not exist

When I run php artisan db:seed I am getting the following error: [ReflectionException] Class SongsTableSeeder does not exist What is going on? My DatabaseSeeder class:
Sasha
  • 8,521
  • 23
  • 91
  • 174
323
votes
39 answers

Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Migration error on Laravel 5.4 with php artisan make:auth [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071…
abSiddique
  • 11,647
  • 3
  • 23
  • 30
318
votes
12 answers

Laravel Migration Change to Make a Column Nullable

I created a migration with unsigned user_id. How can I edit user_id in a new migration to also make it nullable()? Schema::create('throttle', function(Blueprint $table) { $table->increments('id'); // this needs to also be nullable, how…
user391986
  • 29,536
  • 39
  • 126
  • 205
306
votes
34 answers

Laravel: How to Get Current Route Name? (v5 ... v7)

In Laravel v4 I was able to get the current route name using... Route::currentRouteName() How can I do it in Laravel v5 and Laravel v6?
Md Rashedul Hoque Bhuiyan
  • 10,151
  • 5
  • 30
  • 42
299
votes
25 answers

"Please provide a valid cache path" error in laravel

I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following commands again: composer self-update composer-update npm install bower install I configured my routes and everything…
user3718908x100
  • 7,939
  • 15
  • 64
  • 123
296
votes
30 answers

How to remove /public/ from a Laravel URL

I want to remove the /public/ fragment from my Laravel 5 URLs. I don't want to run a VM, this just seems awkward when switching between projects. I don't want to set my document root to the public folder, this is also awkward when switching between…
user1537360
  • 4,751
  • 6
  • 26
  • 22
265
votes
24 answers

How to select specific columns in laravel eloquent

lets say I have 7 columns in table, and I want to select only two of them, something like this SELECT `name`,`surname` FROM `table` WHERE `id` = '1'; In laravel eloquent model it may looks like this Table::where('id', 1)->get(); but I guess this…
devnull Ψ
  • 3,779
  • 7
  • 26
  • 43
259
votes
16 answers

Laravel - create model, controller and migration in single artisan command

I can create a model and resource controller (binded to model) with the following command php artisan make:controller TodoController --resource --model=Todo I want to also create a migration with the above command, is it possible?
arun
  • 4,595
  • 5
  • 19
  • 39
250
votes
14 answers

How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?

I would like to make a timestamp column with a default value of CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP using the Laravel Schema Builder/Migrations. I have gone through the Laravel documentation several times, and I don't see how I can make…
JoeyD473
  • 2,890
  • 2
  • 21
  • 25
248
votes
3 answers

How to comment in laravel .env file?

I am working on a project in Laravel where I am storing some settings in .env file setting like few parameters for testing purpose and few parameters are for live working so I was just checking that is there any way to comment in .env file of…
Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
1
2 3
99 100