jeudi 13 septembre 2018

Undefined variable: request - Laravel 5.1

I have include this on top of my file

use Request;

and also,

use Illuminate\Http\Request;


When I tried use

$files = $request->file('images');
dd($files);

I kept getting

ErrorException in PortfolioController.php line 113: Undefined variable: request

Why ?

According to the doc of 5.1

https://laravel.com/docs/5.1/requests

use Illuminate\Http\Request;

should be enough.


Controller

public function update($id) {

    $files = $request->file('images');

    ...

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire