Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

__invoke in laravel

use AppHttpControllersController;
use AppModelsUser;

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

use AppHttpControllersProvisionServer;

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

php artisan make:controller ProvisionServer --invokable
 
PREVIOUS NEXT
Tagged: #laravel
ADD COMMENT
Topic
Name
6+2 =