when making the module there is no folder for models
where models put on this item?
I put the model to make a new directory in
Module/Auth/Models/Auth.php
maybe next update so you generate a model automatically when running the command
php artisan module: make modname
Default path for models is Modules/ModuleName/Entities
You can generate models by using php artisan module:make-model [model] [module] command
@ridwanskaterock check wiki docs and artisan commands before create issues!!
@ercanertan you need to chill. he was asking a question.
Hi, How can I use a model ? For example I have a module : Gallery and a model ( Modules/Gallery/Entities/GalleryCategories When I can type Use Modules/Gallery/Entities/GalleryCategories => Class 'Modules\Gallery\Entities\GalleryCategories' not found
@macikgoz25 have you added modules directory to composer.json and executed dump-autoload?
```{
"autoload": {
"psr-4": {
"App\": "app/",
"Modules\": "Modules/"
}
}
}
The model directory is called Entities by default. This can be changed in the configuration.
when I run php artisan module:make-model Panel
I have this error
Nwidart\Modules\Exceptions\ModuleNotFoundException : Module [] does not exist!
at C:\Users\ASUS\Desktop\laravel\blog\vendor\nwidart\laravel-modules\src\FileRepository.php:396
could u help me please
Use php artisan module:make-model --help, you will see there are 2 arguments, module name and model name.
Wooow...thank u very much..it is working
Awesome :)
php artisan module:make-model CategoryModel Category
If you have a Module called Category and if you want to create a model named CategoryModel
N.B: I just used Model to show the difference. You can use
php artisan module:make-model Category Category
You will find your Model in Entities folder.
Most helpful comment
The model directory is called
Entitiesby default. This can be changed in the configuration.