Questions tagged [laravel-5.4]

Laravel 5.4 is a past version of the open-source PHP web framework replaced by 5.5 version created by Taylor Otwell. It was released on January 24, 2017. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.4. Use the laravel tag for general laravel related questions.

What is new:

  • Markdown Mail & Notifications
  • Laravel Dusk - BrowserKit testing replaced with ChromeDriver
  • Laravel Mix replaces Laravel Elixir
  • Blade Components & Slots
  • Implicit model binding for broadcast channels
  • Collection Higher Order Messages
  • Object Based Eloquent Events
  • Job Level Retry & Timeout
  • Request Sanitization Middleware
  • Realtime Facades
  • Custom Pivot Table Models
  • Improved Redis Cluster Support

Resources:

Other notable tags:

4230 questions
235
votes
7 answers

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/eloquent-sluggable Do not run Composer as root/super…
alex
  • 5,897
  • 7
  • 38
  • 66
235
votes
34 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…
absiddiqueLive
  • 8,476
  • 3
  • 20
  • 29
169
votes
14 answers

Laravel 5.4 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
  • 3,506
  • 3
  • 16
  • 32
131
votes
6 answers

How to validate array in Laravel?

I try to validate array POST in Laravel: $validator = Validator::make($request->all(), [ "name.*" => 'required|distinct|min:3', "amount.*" => 'required|integer|min:1', "description.*" => "required|string" …
Darama
  • 2,120
  • 4
  • 18
  • 33
96
votes
24 answers

Laravel 5.4 Specific Table Migration

Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations. Is there a way on how to migrate a certain migration file (1 migration only), cause right now every time there is a change I use php artisan migrate:refresh and…
Martney Acha
  • 2,144
  • 3
  • 22
  • 42
63
votes
11 answers

How to logout and redirect to login page using Laravel 5.4?

I am using Laravel 5.4 and trying to implement authentication system. I used php artisan command make:auth to setup it. I edited the views according to my layout. Now, when I am trying to logout it throwing me this error NotFoundHttpException in…
Y.EzzEldin
  • 711
  • 1
  • 5
  • 10
48
votes
5 answers

Laravel Blade - Advantage of @slot/@component vs @include?

Laravel 5.4 Blade introduced the concept of components & slots - but I can't see what they add over the traditional @include. As I understand, with component/slots, you do: In template component-tpl.blade.php:
ChrisNY
  • 3,195
  • 3
  • 23
  • 27
44
votes
13 answers

Laravel 5.4 Disable Register Route

I am trying to disable the register route on my application which is running in Laravel 5.4. In my routes file, I have only the Auth::routes(); Is there any way to disable the register routes?
Dev.Wol
  • 2,090
  • 8
  • 28
  • 61
41
votes
1 answer

Laravel 5.4 - Validation with Regex

Below is my rule for project name: $this->validate(request(), [ 'projectName' => 'required|regex:/(^([a-zA-z]+)(\d+)?$)/u', ]; I am trying to add the rule such that it must start with a letter from a-z or A-z and can end with numbers but most…
Black
  • 12,789
  • 26
  • 116
  • 196
40
votes
19 answers

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 0 updates, 1 removal - Removing genealabs/laravel-caffeine (0.3.12) Writing lock file Generating optimized…
Prederer Trigger
  • 440
  • 1
  • 4
  • 10
38
votes
25 answers

404 Not Found, but route exist in Laravel 5.4

I'm using PhpStorm. I can run and open the index.php, but when I want to press submit button (post sign in), its display 404 not found. Web server Apache 2.4 running on Windows 10. This is my home This is my route
user5655563
38
votes
11 answers

laravel 5.4 upload image

My controller code for upload file in laravel 5.4: if ($request->hasFile('input_img')) { if($request->file('input_img')->isValid()) { try { $file = $request->file('input_img'); $name = rand(11111, 99999) . '.' .…
Sawung Himawan
  • 381
  • 1
  • 3
  • 4
33
votes
1 answer

Pluck with Where condition

I can take the list using $specialities = Speciality::pluck('name','id') Why isn't the following code working? What could be an alternative? I am returning this array by ajax to form a select box. So I thought pluck (list in laravel 4+) would be…
siddiq
  • 1,463
  • 2
  • 15
  • 34
33
votes
9 answers

Laravel 5.4 field doesn't have a default value

I am having this error and none of the googled result i checked is similar to my problem. I have an application with class Deal, User, and Matches A deal has many matches. A user has many matches. A user has many deals. I am attempting to create a…
John David
  • 644
  • 1
  • 10
  • 20
32
votes
2 answers

Match JsonStructure in PhpUnit Test - Laravel 5.4

I am creating a unit test and want to test the JSON structure returned in the response. I am aware that the TestResponse provides a method assertJsonStructure to match the structure of your JSON response. But for some reason I am unable to map the…
Farooq Ahmed Khan
  • 3,399
  • 2
  • 23
  • 36
1
2 3
99 100