app/Http/Controllers/PartController.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)
    {
        $input = $request->all();
        if ($image = $request->file('image')) {
            $destinationPath = 'image/';
            $profileImage = date('YmdHis') . "." . $image->getClientOriginalExtension();
            $image->move($destinationPath, $profileImage);
            $input['image'] = "$profileImage";
        }
        Parts::create($input);
        return redirect('/parts/create')->with('success', 'Part is successfully saved');    }
public function store ( Request $ request ) { $ input = $ request -> all ( ) ; if ( $ image = $ request -> file ( 'image' ) ) { $ destinationPath = 'image/' ; $ profileImage = date ( 'YmdHis' ) . " . " . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( $ destinationPath , $ profileImage ) ; $ input [ 'image' ] = " $ profileImage " ; } Parts :: create ( $ input ) ; return redirect ( '/parts/create' ) -> with ( 'success' , 'Part is successfully saved' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .