Questions tagged [laravel-5.5]

Laravel 5.5 is a previous version, but the current LTS version, of the open-source PHP web framework created by Taylor Otwell. It was released on August 30, 2017. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.5. Use the laravel tag for general laravel related questions.

Laravel 5.5 is a previous version, but current LTS version, of Laravel 5. It was released on August 30,2017.

What is new:

  • New Whoops integration
  • Streamlined Request Validation
  • Fresh Migrations
  • Frontend Presets
  • Automatic Package Discovery
  • Silky Smooth Custom Validation Rules
  • Collection Dumping
  • Model Factory Generation
  • Custom Blade "If" Directives
  • Auto-Registering Artisan Commands
  • Higher Order Tap
  • Optional Objects
  • New API Resources

Resources:

2496 questions
9
votes
3 answers

In Laravel 5.5, how to get the Job ID after we dispatch a job to the job queue?

Until Laravel 5.4, the dispatch() method returned the queue job id. $job = (new JobClass())->onQueue('queuename'); $jobId = dispatch($job); dd($jobId); // prints the job id In 5.5, it returns a PendingDispatch object, which does not seem to have a…
SteveVg
  • 481
  • 5
  • 11
9
votes
3 answers

change value of $request before validation in laravel 5.5

I have a form in route('users.create'). I send form data to this function in its contoller: public function store(UserRequest $request) { return redirect(route('users.create')); } for validation I create a class in…
Maria
  • 185
  • 1
  • 2
  • 12
8
votes
6 answers

Add new columns to existing table in a migration in Laravel

I want to add some new columns in my existing table users in laravel. I have already googling for that and following those search I have already created migration using the command php artisan make:migration…
Arafat Rahman
  • 993
  • 5
  • 19
  • 46
8
votes
5 answers

Not receiving the $message variable in view from a Laravel HTML Mailable (NON Markdown)

I've read several similar questions related to this problem but all refer to Markdown mailables. I'm trying to send inline images in the mailables but I haven't found a way to do it properly (Laravel 5.5). The documentation says this: Inline…
Kenny Horna
  • 13,485
  • 4
  • 44
  • 71
8
votes
2 answers

Laravel 5: assertSeeText() and html entities

I'm using PHP Faker to generate random data (using factories) in the database and sometimes it generates apostrophes. In my test, I use assertSeeText(). The problem is that when the tested string contains special characters such as apostrophes,…
SystemGlitch
  • 2,150
  • 12
  • 27
8
votes
3 answers

ResourceCollection doesn't include pagination links

CommentsCollection class CommentsCollection extends ResourceCollection { public function toArray($request) { return [ 'data' => $this->collection ]; } } CommentsController public function index() { $post…
Src
  • 5,252
  • 5
  • 28
  • 56
8
votes
3 answers

Laravel 5.5 Blade route() parameter

Can I add a parameter which I can use in a blade template, and which doesn't appear in the url? route("Home", ['id' => 1]); @if(isset($id)) //Do something @endif
s1njar
  • 123
  • 1
  • 1
  • 9
8
votes
1 answer

Trying to access variable outside laravel collection->each

I am trying to access variable outside laravel collection->each, but I get .. Undefined variable: headers Here's my code: public function bulkCoding(Request $request) { Excel::load($request->file, function($reader) { $headers =…
CairoCoder
  • 3,091
  • 11
  • 46
  • 68
8
votes
3 answers

Send raw mail via queue Laravel

For testing purpose, I want to send raw mail via Queue. I can send a raw mail like this: Mail::raw('bonjour', function($message) { $message->subject('Email de test') ->to('test@example.org'); }); But is there a way to send a raw mail…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
8
votes
1 answer

What is the purpose of API Resources?

I've read the docs and watched the Laracast. I'm still left wondering why you would use them? I get that you can map different data to different names if your field names were to change but you want to keep a consistent public API. But surly you can…
panthro
  • 22,779
  • 66
  • 183
  • 324
8
votes
1 answer

Run Laravel Horizon as a background service

My question is what is the best and simple way to run the Laravel Horizon based job workers? My Tech Stack Laravel 5.5 Horizon Redis Queues Centos I have gone through the document https://laravel.com/docs/5.5/horizon How to setup following…
BetaDev
  • 4,516
  • 3
  • 21
  • 47
8
votes
7 answers

Is there some sort of Laravel Controller cache?

Weird problem I'm having with Laravel 5.5 I can update and even delete a controller and yet it appears as if a cached / old version is still being called. I've tried clearing cache, clearing route cache, clearing config cache - doesn't seem to have…
jeremyj11
  • 589
  • 1
  • 5
  • 15
8
votes
4 answers

Laravel - how to get the query with bind parameters?

I can get the not-bind query on with this way : \DB::enableQueryLog(); $items = OrderItem::where('name', '=', 'test')->get(); $log = \DB::getQueryLog(); print_r($log); Output is : ( [0] => Array ( [query] => select * from…
fico7489
  • 7,931
  • 7
  • 55
  • 89
8
votes
4 answers

Laravel 5.5 - Check if string contains exact words

In laravel, I have a $string and a $blacklistArray $string = 'Cassandra is a clean word so it should pass the check'; $blacklistArray = ['ass','ball sack']; $contains = str_contains($string, $blacklistArray); // true, contains bad word The result…
Wonka
  • 8,244
  • 21
  • 73
  • 121
8
votes
2 answers

Refresh laravel migration for specific table

Can I run php artisan migrate:refresh for specific table? Or can I refresh specific table migration in general? I tried this: php artisan migrate --path=/database/migrations/selected/ But it's not working!
CairoCoder
  • 3,091
  • 11
  • 46
  • 68