app/Http/Controllers/Backend/AdminController.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([
        'name' => 'required|unique:admins|max:255',
        'email'=> 'required|email',
        'password' => 'required',
        ]);
        Admin::create([
            'name' =>$request->name,
            'email' =>$request->email,
            'password' =>Hash::make($request['password']),
            'is_super' =>true,
        ]);
        return back()->with('message','User Created Successfully');
    }
public function store ( Request $ request ) { $ validatedData = $ request -> validate ( [ 'name' => 'required|unique:admins|max:255' , 'email' => 'required|email' , 'password' => 'required' , ] ) ; Admin :: create ( [ 'name' => $ request -> name , 'email' => $ request -> email , 'password' => Hash :: make ( $ request [ 'password' ] ) , 'is_super' => true , ] ) ; return back ( ) -> with ( 'message' , 'User Created Successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// $all = $request->all(); // $all = Hash::make($request['password']);