All Questions
37,647 questions
519
votes
25
answers
673k
views
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: ...
443
votes
26
answers
736k
views
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 ...
429
votes
22
answers
836k
views
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 /...
413
votes
33
answers
948k
views
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?
341
votes
40
answers
516k
views
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] ...
339
votes
29
answers
484k
views
"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 ...
339
votes
4
answers
605k
views
PHP7 : install ext-dom issue
I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error:
pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/...
331
votes
12
answers
485k
views
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('...
328
votes
15
answers
216k
views
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:
<?php
use Illuminate\...
324
votes
35
answers
696k
views
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?
300
votes
30
answers
415k
views
How to remove /public/ from a Laravel URL [duplicate]
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 ...
282
votes
25
answers
775k
views
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
...
274
votes
16
answers
580k
views
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 ...
263
votes
3
answers
184k
views
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 ...