app/Http/Controllers/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 = new User();
        $user->username = $request->input('username');
        $user->email = $request->input('email');
        $user->phone_number = $request->input('phone_number');
        $user->role = $request->input('role');
        $user->password = Hash::make('11111111');
        $user->save();
        toastr()->success('A new '.$user->role.' Added');
        return redirect('/users');
    }
public function store ( Request $ request ) { $ user = new User ( ) ; $ user -> username = $ request -> input ( 'username' ) ; $ user -> email = $ request -> input ( 'email' ) ; $ user -> phone_number = $ request -> input ( 'phone_number' ) ; $ user -> role = $ request -> input ( 'role' ) ; $ user -> password = Hash :: make ( '11111111' ) ; $ user -> save ( ) ; toastr ( ) -> success ( 'A new ' . $ user -> role . ' Added' ) ; return redirect ( '/users' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .