public function uploadFile(Request $request)
{
if($request -> hasFile('file')) {
$task = Task::find(1);
if( mime_content_type($request) == 'image/png') {
$task->addMedia($request->file('file'))->toMediaCollection('images');
}
}
}