app/Http/Controllers/Admin/UserController.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)
    {
        $user = User::create([
            'f_name' => $request->firstName,
            'l_name' => $request->lastName,
            'email' => $request->email,
            'password' => Hash::make($request->password),
            'phone_no' => $request->phone_no,
           'address' => $request->address,
        ]);
        if($user){
            return redirect()->route('users.index')->with('message','Record Added Successfully');
        }else{
            return redirect()->route('users.create')->with('message','Something Went Wrong');
        }
    }
public function store ( Request $ request ) { $ user = User :: create ( [ 'f_name' => $ request -> firstName , 'l_name' => $ request -> lastName , 'email' => $ request -> email , 'password' => Hash :: make ( $ request -> password ) , 'phone_no' => $ request -> phone_no , 'address' => $ request -> address , ] ) ; if ( $ user ) { return redirect ( ) -> route ( 'users.index' ) -> with ( 'message' , 'Record Added Successfully' ) ; } else { return redirect ( ) -> route ( 'users.create' ) -> with ( 'message' , 'Something Went Wrong' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .