Create a folder and put a model file in it. As long as the namespace is correct it should work.
Moving the User model needs a few more changes. Update the namespace in the model file and update the the config\auth.php
I have yet to do this as i'm looking in to repositories.
Here are some links that were posted in another topic related to repositories, http://laravel.io/forum/10-26-2014-laravel-5-where-is-the-models-folder
Here's some resources on the matter:
- Laracasts: Repositories Simplified (highly recommended)
- Creating flexible Controllers in Laravel 4 using Repositories
- Two Design Patterns That Will Make Your Applications Better
- The Repository Pattern in Action
Edit
I also forgot about this Laracasts video which would be helpful in general as well:
Hope that helps.
For example if you create a folder (eg app/Models), there are two ways to move your models:
"autoload": {
"classmap": [
"database",
"app/Models"
],
...
Matt Stauffer has an excelent post Upgrading from Laravel 4 to Laravel 5
Extra notes:
@igaster Just to make sure I'm thinking correctly.
The Laravel 4 style would require you to do a 'composer dump-autoload', if you added in any new models, right ?
And thanks for the better explanation.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community