-
Notifications
You must be signed in to change notification settings - Fork 44
Create a new Service file
MisterDebug edited this page Aug 12, 2023
·
1 revision
With the command make:service
, you can create a Service file.
Example in real life, you want to create a PostService
file
Let's create your Service :
php artisan make:Service PostService
That's it :)
By default, your file will be created in app/Services
directory and App\Services
namespace
You can customize namespace and path in crudgen.php
, add this array and fill it with your data :
'paths' =>
[
'service' =>
[
'path' => app_path('Services'),
'namespace' => 'App\Services'
]
]
You can delete service created by the make:service
command
php artisan rm:service nameService --force
php artisan rm:service PostService --force
(in our example)
--force (optional) can delete file without confirmation