Skip to content
Advertisement

laravel 5.4 custom command not working

This is the first time i’m working in Laravel. I’m developing a custom command which will read a file and insert rows in database. I’m getting errors. Below is my code any help will be appreciated.

Command File.

JavaScript

Model File

JavaScript

Kernel.Php

JavaScript

ERRORs: D:xampphtdocslara12>php artisan ship:start PHP Fatal error: Class ‘AppConsoleCommandsShipNow’ not found in D:xampphtdocslara12appConsoleCommandsshipdata.php on line 26

[SymfonyComponentDebugExceptionFatalErrorException] Class ‘AppConsoleCommandsShipNow’ not found

Advertisement

Answer

ShipNow::ShipNow() should be Ship::ShipNow(), since that’s the name of the Model and you call it as a static method, so it has to be a static method in the Ship file:

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