Route::get('customer/{id}', 'Customer@method'); <-- want to call construct not method
class Customer extends Controller
{
public function __construct(){
echo 123456;
}
I'm new in laravel
I try to call __construct from my controller without method, but I got error, is anyone know how to do it?
Try to do like this
Route::resource('customer/{id}', 'Customer');
use Route; public function __construct() { $id = Route::current()->getParameter('id'); dd($id); }