app/Http/Controllers/MemberController.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)
    {
        $this->validate($request,[
            'name' => 'required|max:50',
            'position' => 'required|max:50',
            'photo' => 'required|image',
            'description' => 'required' 
        ]);
        $photo = $request->photo;
        $featured_new_name = time().$photo->getClientOriginalName();
        $photo->move('admin/uploads/images',$featured_new_name);
        $post = Member::create([
            'name' => $request->name,
            'position' => $request->position,
            'photo' => 'admin/uploads/images/'.$featured_new_name,
            'description' => $request->description,
            'facebook' => $request->facebook,
            'linkedin' => $request->linkedin,
            'twitter' => $request->twitter,
            'user_id' => $request->user_id
        ]);
        Session::flash('success','You have created member succesfully');
        return redirect()->back();
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'name' => 'required|max:50' , 'position' => 'required|max:50' , 'photo' => 'required|image' , 'description' => 'required' ] ) ; $ photo = $ request -> photo ; $ featured_new_name = time ( ) . $ photo -> getClientOriginalName ( ) ; $ photo -> move ( 'admin/uploads/images' , $ featured_new_name ) ; $ post = Member :: create ( [ 'name' => $ request -> name , 'position' => $ request -> position , 'photo' => 'admin/uploads/images/' . $ featured_new_name , 'description' => $ request -> description , 'facebook' => $ request -> facebook , 'linkedin' => $ request -> linkedin , 'twitter' => $ request -> twitter , 'user_id' => $ request -> user_id ] ) ; Session :: flash ( 'success' , 'You have created member succesfully' ) ; return redirect ( ) -> back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .