Laravel 11で追加されたartisanの挙動を確認しよう!
Laravel 11のインストール
Laravel 11はPHP8.2以上が必要です
composer create-project laravel/laravel:^11.0 example-app
cd example-app
php artisan make:class
$ php artisan make:class Hoge
INFO Class [app/Hoge.php] created successfully.
example-app/app/Hoge.php
<?php
namespace App;
class Hoge
{
/**
* Create a new class instance.
*/
public function __construct()
{
//
}
}
php artisan make:enum
$ php artisan make:enum Hoge
INFO Enum [app/Hoge.php] created successfully.
example-app/app/Hoge.php
<?php
namespace App;
enum Hoge
{
//
}
php artisan make:interface
$ php artisan make:interface Hoge
INFO Interface [app/Hoge.php] created successfully.
example-app/app/Hoge.php
<?php
namespace App;
interface Hoge
{
//
}
php artisan make:trait
$ php artisan make:trait Hoge
INFO Trait [app/Hoge.php] created successfully.
example-app/app/Hoge.php
<?php
namespace App;
trait Hoge
{
//
}