Skip to content
Advertisement

What are the CRUD Commands that have to be run in Tinker with Laravel 8

When I run the known tinder CRUD Commands in Laravel 8, they aren’t working

What I ran was the Create and Find commands

JavaScript
JavaScript

But they aren’t working, I knew that in Laravel 8, the Model file is in this path AppModels ‘File’, and I tried to modify the creating code from $user = new AppUser; to $user = new AppModelsUser; But also this doesn’t work and the error I get is

JavaScript

So generaty what are the changes to tinker in Laravel 8

Note: I also tried to clear the cache and clear the composer and it didn’t solve the problem.

Advertisement

Answer

In Laravel 8, you should do it this way:

JavaScript

or above the controller class declaration, do

JavaScript

then in the method, you can do

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement