📜  __invoke in laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:02.944000             🧑  作者: Mango

代码示例1
use App\Http\Controllers\Controller;
use App\Models\User;

class ProvisionServer extends Controller
{
    /**
     * Provision a new web server.
     *
     * @return \Illuminate\Http\Response
     */
    public function __invoke()
    {
        // ...
    }
}

use App\Http\Controllers\ProvisionServer;

Route::post('/server', ProvisionServer::class);

php artisan make:controller ProvisionServer --invokable