oroalej
2 weeks ago

Create Request with File in Controller

Posted 2 weeks ago by oroalej

Hi all,

How can I create a Request() with file inside Controller Currently, I'm doing the code below but the $request->file('video') returns null;

use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;

....

$path =  new UploadedFile( $tempPath, $formattedFileName );


$request = new Request( [
    // Some Variables..
    'a_file' => $path
]);

dd($request->file('a_file'));

Please sign in or create an account to participate in this conversation.