1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Laravel 11のアーティさん【php artisan make:class/enum/interface/trait】

Posted at

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
{
    //
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?