validate([ 'file' => 'required|mimes:doc,pdf,docx' ]); $file = $request->file('file')->store('technotransport'); // $techno_transport = new TechnoTransport(); $techno_transport = TechnoTransport::create($request->all()); $techno_transport->file = $file; $techno_transport->save(); return response()->json([ 'status' => 200, 'data' => $techno_transport ]); } }