mercredi 13 juin 2018

Why should I use variable type in Laravel

PHP is a loose type language right ? im working with laravel 5.1 php 7.2

I would make my route like this

Route::get('/getSizes', 'JobTickeController@getSizes')->name('getSizes');

in JobTicketController there i define my function as below

public function getSizes(Request $response){

}

my Question is even if php is loosy type why should I define Request variable type before $request variable. There is an exception without the type Request



via Chebli Mohamed

2 commentaires: