app/Http/Controllers/RemittanceController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $upload = $request->file('upload_file')->store('upload');
         echo $request->upload_name;
        $request->validate([
            'upload_name' => 'required',
            'upload_file' => 'required',
            'upload_user_id' => 'required',
        ]);
        $remittance = new Remittance;
        $remittance->file_name = $request->upload_name;
        $remittance->file_path = $upload;
        $remittance->user_id = $request->upload_user_id;
         Remittance::create($request->all());
        $remittance->save();
        return redirect('/');
    }
public function store ( Request $ request ) { $ upload = $ request -> file ( 'upload_file' ) -> store ( 'upload' ) ; $ request -> validate ( [ 'upload_name' => 'required' , 'upload_file' => 'required' , 'upload_user_id' => 'required' , ] ) ; $ remittance = new Remittance ; $ remittance -> file_name = $ request -> upload_name ; $ remittance -> file_path = $ upload ; $ remittance -> user_id = $ request -> upload_user_id ; $ remittance -> save ( ) ; return redirect ( '/' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// // echo $request->upload_name; // Remittance::create($request->all());