app/Http/Controllers/Index/ClientController.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)
    {
        $post = request()->except('_token');
        $id = Auth::id();
        if($request->hasFile('file')){
            $post['file'] = $this->upload('file');
        }
        $post['id'] = $id;
        $post['client_time'] = time();
        $res = Client::create($post);
        if($res){
            return redirect('/client/index');
        }
    }
public function store ( Request $ request ) { $ post = request ( ) -> except ( '_token' ) ; $ id = Auth :: id ( ) ; if ( $ request -> hasFile ( 'file' ) ) { $ post [ 'file' ] = $ this -> upload ( 'file' ) ; } $ post [ 'id' ] = $ id ; $ post [ 'client_time' ] = time ( ) ; $ res = Client :: create ( $ post ) ; if ( $ res ) { return redirect ( '/client/index' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
// dd($id); // $id = request()->input('id'); // dd($post['id']); // dd($res);