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)
    {
        $validatedData = $request->validate([
            'nama_dpn' => 'required|max:25',
            'nama_blkng' => 'required|max:25',
            'email' => 'required|unique:users',
            'password' => 'required|min:5|max:25',
        ]);
        $validatedData['password'] = bcrypt($validatedData['password']);
        User::create($validatedData);
        $request->session()->flash('success', 'Berhasil menambah data!');
        return redirect('/user');
    }
public function store ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'nama_dpn' => 'required|max:25' , 'nama_blkng' => 'required|max:25' , 'email' => 'required|unique:users' , 'password' => 'required|min:5|max:25' , ] ) ; $ validatedData [ 'password' ] = bcrypt ( $ validatedData [ 'password' ] ) ; User :: create ( $ validatedData ) ; $ request -> session ( ) -> flash ( 'success' , 'Berhasil menambah data!' ) ; return redirect ( '/user' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .