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:

4188 questions
14
votes
4 answers

Force Laravel to log in a user using legacy authentication

I am trying to slowly integrate Laravel into a legacy PHP application. One of the tasks is to automatically register a Laravel user session when a user logs in to the old app. I am not trying to implement Laravel authentication, I really just want…
Jeff Lambert
  • 24,395
  • 4
  • 69
  • 96
14
votes
3 answers

Without using auth middleware, how to get user id by token?

In Laravel 5.4, using oauth2/passport, I've a route that is public - so I don't use middleware auth. This route is accessed by users logged in and not logged in. I want to take the user id o who is accessing this route (if is logged in). Without…
pedrofsn
  • 326
  • 2
  • 15
14
votes
1 answer

Laravel Mix disable file loader for url()

Laravel 5.4 introduced laravel mix with webpack. There is no clear documentation for working with images in laravel mix(like, how it works and to customize it for our needs). Since it is not working as I expected, I would like to disable it for my…
Shankar Prakash G
  • 1,099
  • 18
  • 34
13
votes
3 answers

Laravel 5.4 mail messages how to edit header and footer

Hi I am trying to use MailMessage function in my Laravel App. My question is very simple. How to edit the Header and the Footer when receiving email from the app? Here is the picture below. I want to change the header Laravel from my App name and…
Jaaayz
  • 1,533
  • 7
  • 27
  • 59
13
votes
1 answer

Laravel 5.4 blade foreach loop

I am building a venue manangement system, and on the landing page, i m trying to show all the available slots to the visitors. The ones that have already been booked are shown as not available. I have created two variables, one that carries the info…
13
votes
2 answers

Laravel Echo never recieving event

For whatever reason, I cannot receive any data on my client side from laravel echo. I am using laravel-echo-server (socket.io), redis broadcaster, and redis queues. As far as I can tell, they are all functional. I'll take you through how I set it up…
Dastur
  • 684
  • 6
  • 23
13
votes
2 answers

Laravel Blade - Chain/Embed multiple layouts

In my favorite templating frameworks they typically have the ability to nest layouts. Is this something that is possible in Blade? For example... master.blade.php @yield('content') …
Jared
  • 5,840
  • 5
  • 49
  • 83
12
votes
1 answer

Laravel queue job doesn't updates to the latest code

I am using a laravel queue job to send emails with an excel attachment. And many a time it is happening, that whenever I update any code change, it doesn't consider the updated code, rather it runs the old code. How can I prevent this?
12
votes
2 answers

Laravel 5.4: How do I validate an image size?

I have a form where a user can submit an image. I don't want to store it on my server in case it's a virus but instead store it to Amazon S3. My issue is that I need to validate if the image is less than a specific dimension. How can I do that in…
MalcolmInTheCenter
  • 1,376
  • 6
  • 27
  • 47
12
votes
1 answer

How to return array with custom key mapWithKeys?

This is code that iterate collection in Laravel: $usersData = $users->mapWithKeys(function ($item) { return [$item->id => array("name" => $item->name, "email" => $item->email, "id" => $item->id)]; }); I tried to get array $usersData with…
POV
  • 11,293
  • 34
  • 107
  • 201
12
votes
1 answer

testing a new window with laravel dusk

I have this page that, when a particular button is clicked, a new window pops up (eg. an anchor tag with _target = blank). I want to verify that a string of text appears in this new window but, with Laravel Dusk, assertSee appears to be testing the…
neubert
  • 15,947
  • 24
  • 120
  • 212
12
votes
5 answers

How to add a custom User Provider in Laravel 5.4

I have a Laravel 5.4 app, in which I have to authenticate my admin users from an external API, which when successfully logged in it returns a JSON with user information. I am creating a custom guard to make this: 'guards' => [ 'web' =>…
Hugo A
  • 413
  • 2
  • 6
  • 23
12
votes
3 answers

How to rollback last vendor publish in laravel

Hi have messed up my project by doing vendor publish here is the command last time i have executed (i'm using LARAVEL 5.4) php artisan vendor:publish --tag=laravel-notifications i want to rollback to previous state which was there before this…
user5405873
12
votes
2 answers

Laravel 5.4 - How to override route defined in a package?

I have created a package in Laravel 5.4 that sets up a basic backoffice. This package contains several routes that are using controllers from within the package. What I want to be able to do is to override the package defined routes in my…
António Quadrado
  • 1,307
  • 2
  • 17
  • 34
12
votes
2 answers

Round image corners using intervention image and laravel 5.4

I need insert some images to another image using intervention image and laravel. This is my main image: And these are my images to insert to main image: And finally this image after insert: Well, I use this code to make this: $img =…
Kiyarash
  • 2,437
  • 7
  • 32
  • 61