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

Laravel manual login function

I use manual login function in Laravel 5.5. Stuck in login. and check all(5 relevant ) Stack links and didn't find any clue on it. Achievement is once user get registered, automatically sign in that user. Error is "Type error: Argument 1…
Stack User
  • 299
  • 1
  • 3
  • 12
21
votes
7 answers

Customising Laravel 5.5 Api Resource Collection pagination

I have been working with laravel api resource. By default laravel provides links and meta as shown below. "links": { "first": "https://demo.test/api/v2/taxes?page=1", "last": "https://demo.test/api/v2/taxes?page=4", "prev": null, …
vikas hemanth
  • 235
  • 1
  • 3
  • 9
21
votes
3 answers

Laravel getting an "Array to string conversion" while storing an Array into a Json database field

I'm trying to save an array with options into a json datafield of my postgres database. I'm working with Laravel 5.5 and I'm using the extension "dimsav/laravel-translatable" for translations. My model Question looks like this: namespace App; use…
JayEJay
  • 263
  • 1
  • 2
  • 7
21
votes
8 answers

Laravel 5.5 set size of integer fields in migration file

I am new to laravel. Now i am using the migrate command to make a table, but the length of the filed is not applicable. Laravel does not provide this option. ? Below is my…
Hax0r
  • 1,722
  • 4
  • 25
  • 43
19
votes
2 answers

Laravel 5.6 - How to get auth()->user() or $response->user() in api controller?

In api.php routes file below, there are public routes and private routes: Route::group(['namespace' => 'API'], function() { // Public routes (auth not required) Route::group([], function() { Route::get('/testauth1',…
Wonka
  • 8,244
  • 21
  • 73
  • 121
18
votes
2 answers

How to set custom response for selected Request class in Laravel 5.5

I'm trying to use Laravel validation to generate custom error message, however I'm unable to find the function I should be overriding. Route: POST:/entries/ uses EntryController@store which uses EntryStoreRequest to perform…
eithed
  • 3,933
  • 6
  • 40
  • 60
18
votes
3 answers

Laravel 5.5 API resources for collections (standalone data)

I was wondering if it is possible to define different data for item resource and collection resource. For collection I only want to send ['id', 'title', 'slug'] but the item resource will contain extra details ['id', 'title', 'slug', 'user',…
Dorin Niscu
  • 721
  • 1
  • 9
  • 26
17
votes
2 answers

Different php.ini file loaded dependant upon the code content

I'm really at loss on what's going on - it all begun with PHPUnit error of Error: No code coverage driver is available when trying to run test coverage report and ended with me debugging to a replicable set described below. But to set the stage -…
eithed
  • 3,933
  • 6
  • 40
  • 60
17
votes
3 answers

How i can return a customized response in a FormRequest class in Laravel 5.5?

I am making an API and i want return the array of errors with a format as the one that $validator->errors(); generates when i validate the request by the manual way. But i cant manipulate the response. I wanna find thhe correct way to make it. This…
16
votes
4 answers

Laravel How to display $hidden attribute on model on paginate

I'm using Laravel 5.5. I read about this and know this function and it works makeVisible $hidden = ['password', 'remember_token', 'email']; I can display email using $profile =…
Goper Leo Zosa
  • 1,185
  • 3
  • 15
  • 33
16
votes
4 answers

Why is my Laravel Eloquent accessor not showing up in the response?

I have a Model Review that has a unix timestamp as 1 of it's attributes (table columns). I use 2 accessors inside this model: public function getReviewDateAttribute($value) { return strftime('%A %e %B %Y', $value); } public function…
online Thomas
  • 8,864
  • 6
  • 44
  • 85
16
votes
2 answers

Google Sign-in in vuejs spa and laravel api

I have a single page application with vue.js that uses Laravel 5.5 as its api. I want to add google sign-in to it but I am confused as where to start. I have used laravel socialite before to add google sign-in but that was for pure laravel…
Ragas
  • 3,005
  • 6
  • 25
  • 42
16
votes
4 answers

Object of class Illuminate\Mail\Message could not be converted to string

I am using Laravel 5.5 trying to send email but getting error Object of class Illuminate\Mail\Message could not be converted to string here is my controller public function contactreply($contact, Request $request){ $reply = new Reply; …
sid heart
  • 561
  • 1
  • 4
  • 9
15
votes
5 answers

How to resolve the error: SQL authentication method unknown in Laravel-MySql

I using docker and I have a container of Laravel Framework 5.5.25 and other with mysql Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL). in my configuration of docker compose I have this: version: "2" services: mysql: image:…
andreszam24
  • 351
  • 2
  • 3
  • 12
15
votes
2 answers

How to add headers in Guzzle http

I'm building a small application in Laravel 5.5 where I'm using Guzzle Http to get call the api url and get the response, Few of the api calls have certain condition to have headers which works as authorization of the request generated. I'm trying…
rajesh
  • 239
  • 2
  • 6
  • 21