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
10
votes
2 answers

Laravel Eloquent: How to use whereDate with Between?

I am using Laravel 5.5, I need to form a query where only date part of a datetime column should be matched, equivalent of date(date_col)='2018-01-01' kind of thing. How do I achieve this in Eloquent way? WhereDate() returns date part but is there…
Volatil3
  • 14,253
  • 38
  • 134
  • 263
10
votes
8 answers

Laravel 5.5 - Validate Multiple Form Request - at the same time

The question is already asked here for a previous version of laravel and not yet answered. I have a html form which is validated using three different Form Request Validations. I am able to do this. But, the problem is, the form validations take…
iamab.in
  • 2,022
  • 3
  • 18
  • 39
10
votes
3 answers

Eloquent / Laravel: How to get last insert/update ID/instance of updateOrCreate()?

The title is mostly self-explanatory. Eloquent has a method called updateOrCreate() documented here: https://laravel.com/docs/5.5/eloquent#other-creation-methods In some cases this is really useful. However after doing updateOrCreate() I need…
Blackbam
  • 17,496
  • 26
  • 97
  • 150
10
votes
5 answers

Validate UUID with Laravel Validation

Is there a built-in way to validate UUID with a validation rule? I did not found anything about this in the "Available Validation Rules" documentation.
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
10
votes
2 answers

how to change api_token column in token guard

Laravel 5.5 I want to change direction of api token that used in TokenGaurd so, i created a custom guard named CafeTokenGaurd extends TokenGuard, i define __construct function into it like what i want, something like this: public function…
Katerou22
  • 777
  • 5
  • 19
10
votes
5 answers

Failed validation returns default error message even though custom messages supplied

I'm not getting the response I expect. This is the controller code for a Location web-service request:
quinny
  • 656
  • 1
  • 7
  • 24
10
votes
4 answers

Laravel 5.5 Consolidate migrations w/ production database

Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the…
Josh Bruce
  • 1,002
  • 13
  • 24
10
votes
4 answers

Laravel optional prefix routes with regexp

Is there a way to create routes with prefixes so I can have routes like this /articles.html -> goes to listing Controller in default language /en/articles.html -> goes to the same controller /fr/articles.html -> goes to the same controller My…
user237329
  • 809
  • 1
  • 10
  • 27
10
votes
3 answers

Laravel 5: php artisan migrate:refresh

I am working on a laravel project and each time I change my table (add or remove column) and run php artisan migrate:refresh. I get this error: [Symfony\Component\Debug\Exception\FatalErrorException] Can't use method return value in write…
mushood badulla
  • 1,043
  • 1
  • 12
  • 19
9
votes
1 answer

Location of auth:api Middleware

Can somebody please tell the location of auth:api middleware? As per the auth:api middleware, the api routes are protected by not null users. I have a boolean field in user table called Is_Admin_Url_Accessible. I want to add a condition in the…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
9
votes
5 answers

Preview Mail Notification in browser

With Laravel, according to the documentation, I can return a Mailable via a controller to display it in the browser. It helps to preview mails. Is there a way to preview Mail Notifications in browser? I tried: return (new…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
9
votes
4 answers

Required field only if another field has a value, must be empty otherwise

My question is about Laravel validation rules. I have two inputs a and b. a is a select input with three possible values: x, y and z. I want to write this rule: b must have a value only if a values is x. And b must be empty otherwise. Is there…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
9
votes
4 answers

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message Laravel 5.5

This is doing my head in. I'm getting this error when trying to login from a form: Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException No message LoginController.php
user9085794
9
votes
3 answers

How to check if validation fail when using form-request in Laravel?

I am trying to write a CRUD for an API. However, when the validation fail, instead of redirecting the user to the home page, I want to return json based response with the errors. I am able to do that using the following code public function…
Junior
  • 11,602
  • 27
  • 106
  • 212
9
votes
2 answers

How to run phpunit in laravel 5.5

I have a problem running phpunit in my laravel 5.5. I already go to vendor/bin and then execute phpunit using my command prompt in windows. But cmd just give another option or flag as shown in the picture below : I have read laravel 5.5…
Maryadi Poipo
  • 1,418
  • 8
  • 31
  • 54