Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created January 31, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/5975d9b743a74327676bd44448f272d7 to your computer and use it in GitHub Desktop.
Save uno-de-piera/5975d9b743a74327676bd44448f272d7 to your computer and use it in GitHub Desktop.
<?php
namespace App\Http\Controllers;
class HomeController extends Controller
{
public function __invoke() { //definimos el método mágico __invoke de PHP
return 'home controller __invoke';
}
}
<?php
use Illuminate\Support\Facades\Route;
Route::get('home', 'HomeController'); //llamada sin método, directamente al controlador
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment