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
15
votes
3 answers

How {{ Auth::user()->name }} is able to print username in blade file?

I have been working in default authentication features in laravel..I found in one blade file Auth::user()->name is able to display name stored in user table..But what i want to know is how it is able display name in blade with an eloquent call.
siva sandeep
  • 557
  • 1
  • 5
  • 17
15
votes
2 answers

Get Laravel Dusk to Run Properly on Ubuntu 16 wt Laravel 5.5

I've been trying to integrate Laravel Dusk into my testing scheme for a week and can't get any test to actually deliver expected results. Here's the situation: I'm running Laravel 55 on Homestead (per Project install) with php 7.1.* I installed…
Chukky Nze
  • 720
  • 3
  • 13
15
votes
22 answers

Laravel 5.5 Error Base table or view already exists: 1050 Table 'users' already exists

Specifications: Laravel Version: 5.5.3 PHP Version: 7.1 Database Driver & Version: MariaDB 10.1.26 Description: C:/Users/user/code/blog/>php artisan migrate [Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists:…
14
votes
4 answers

Laravel : Setting dynamic routes based on access control list

I am building REST API with JWT authentication and authorization with own logic. It's working perfectly. Now, I want to set the routes dynamically based on roles and permission. Suppose I have database structure like: Role: id | name 1 | …
user254153
  • 1,855
  • 4
  • 41
  • 84
14
votes
4 answers

Error in Handler Class - Laravel

I am using Laravel 5.5 and trying to implement multi authentication for users and admin. I am getting this error when i try to call admin login form in browser. Error : Declaration of App\Exceptions\Handler::unauthenticated($request,…
MA-2016
  • 653
  • 3
  • 10
  • 30
13
votes
2 answers

Laravel 5.5 : Testing with DatabaseMigrations deletes all tables

I've been teaching myself how to write test cases in Laravel 5.5. I noticed that, when I run a test class which has DatabaseMigrations trait, all the DB tables relevant to the test class are deleted after running the test. Does this happen by…
Hiroki
  • 3,893
  • 13
  • 51
  • 90
13
votes
1 answer

Sending a mail without creating a Mailable in Laravel 5.5

I don't see anything about sending Mail without creating a Mailable class in Laravel 5.5 documentation. I know it was possible before (5.2) but I don't remember how. Is it still possible? Is it deprecated? Is there something I missed in the…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
13
votes
2 answers

Why is validate() method accessible via request()?

Quoting the Laravel documentation: By default, Laravel's base controller class uses a ValidatesRequests trait which provides a convenient method to validate incoming HTTP request with a variety of powerful validation rules It's true, reading the…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
13
votes
6 answers

laravel eloquent resources api send status code

In Laravel 5.5 We can set API through resources (https://laracasts.com/series/whats-new-in-laravel-5-5/episodes/20), but how can we send STATUS CODE? Also how should I set status dynamically which is defined in with() //namespace…
user7498776
  • 139
  • 1
  • 1
  • 5
13
votes
2 answers

How can I configure an SCP/SFTP file storage?

My Laravel application should copy files to another remote host. The remote host is accessible only via SCP with a private key. I would like to configure a new file storage (similarly as FTP), but I have found no information, how to define an SCP…
Antonín Slejška
  • 1,980
  • 4
  • 29
  • 39
12
votes
1 answer

Laravel mix always undefined in mix v4+

Any call to npm run after upgrading to Mix v4.x results in mix being undefined. I see errors like this on every run: > npm run development > @ development /project > cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress…
eComEvo
  • 11,669
  • 26
  • 89
  • 145
12
votes
1 answer

Laravel 5.5 - SerializesModels on event causes ModelIdentifier error?

I have a laravel event with a few listeners. Some listeners or their notifications (depending if they are time consuming) are implementing the ShouldQueue so they run in the background on a redis queue. The event uses SerializesModels by default,…
Wonka
  • 8,244
  • 21
  • 73
  • 121
12
votes
1 answer

Laravel The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

I'm running Laravel app on server (Ubuntu 16.04). I have an error The stream or file "/var/www/mydomain.com/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied I've already google my question. I found this…
user9250371
12
votes
3 answers

Laravel 5.5 Method save does not exist when updating entries with modified primary key

I am working with laravel 5.5 to update entries. The problem is after changing the primary key 'id', which is elequoent default pk to 'project_id'. adding an item works fine but updating an item is not working properly. Here is the error I am…
Melaku Minas Kasaye
  • 640
  • 2
  • 8
  • 31
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