【Laravel】artisanのmake:exceptionコマンドを解説

Laravel

Laravel 10.xのartisanの「make:exception」コマンドを解説します。

Description

新しいカスタム例外クラスの作成

Usage

php artisan make:exception [-f|--force] [--render] [--report] [--] <name>

Arguments

引数必須説明
name必須例外クラス名

Options

オプション省略形必須説明
forcef-例外がすでに存在する場合でもクラスを作成する
render--空のレンダリングメソッドで例外を作成する
report--空のレポートメソッドで例外を作成する

Examples

no options

php artisan make:exception FooException
   INFO  Exception [app/Exceptions/FooException.php] created successfully.  
<?php

namespace App\Exceptions;

use Exception;

class FooException extends Exception
{
    //
}

Follow me!

コメント

PAGE TOP
タイトルとURLをコピーしました