Nov 25, 2018
Move laravel models to Models folder
1. Move the files to the Models folder
2. Change the namespace of the models
Change :
namespace App;
to
namespace App\Models;
3. Change the other files
Search for app\User and change
app/Http/Controllers/Auth/RegisterController.php
config/auth.php
config/services.php
database/factories/ModelFactory.php
database/factories/UserFactory.php
All Controllers
And change App/ModelTest to App/Models/ModelTest
4. Run composer dump-autoload
2. Change the namespace of the models
Change :
namespace App;
to
namespace App\Models;
3. Change the other files
Search for app\User and change
app/Http/Controllers/Auth/RegisterController.php
config/auth.php
config/services.php
database/factories/ModelFactory.php
database/factories/UserFactory.php
All Controllers
And change App/ModelTest to App/Models/ModelTest
4. Run composer dump-autoload
Subscribe to:
Posts (Atom)