Laravel 11 introduced new Artisan commands. Let's look at the make:trait
command in this post.
As with every Artisan command, you can pass the file name to create or leave empty, and Laravel will ask.
Here is how the generated interface looks like:
app/Traits/Sluggable.php:
namespace App\Traits; trait Sluggable{ //}
As with every generated file, the interface also has stubs so that you can modify them to your needs. After publishing the subs, you can find stubs/trait.stub
.
<?php namespace {{ namespace }}; trait {{ class }}{ //}
The make:trait
Artisan command has additional options, which you can check by adding the --help
option.
I think you meant The make:trait instead of The make:enum
Thanks for the notice