Invokable Controller for Lavarel 7

namespace App\Http\Controllers;

class InvokableController extends Controller
{
    public function __invoke()
    {
        return 'This is an invokable controller';
    }
}
Route::get('/invokable', 'InvokableController');

© 2020 DevDojo LLC. All rights reserved.