0

I wanted to give option to create users for Admin without using Registration form.

Do I need to change existing methods and forms ? How do I store password with encryption same as in default registration option. what is the best way to do it?

UserController class is already created using

php artisan make:controller PhotoController

class UserController extends Controller {
    public function create()
    {
         $users = User::get();
         return view('user.index', compact('users'));       
    }
    public function store()
    {
         $input = Request::all();
         ........
    }
}
nhaarman
  • 98,571
  • 55
  • 246
  • 278
Chanuka Asanka
  • 2,798
  • 3
  • 24
  • 36
  • Imo the best option is to have a flag is_admin (or a bunch of roles) in the database. After registration you could manually update your user with setting is_admin = true. In case you really need to create 'em without a registration form you can write a command for it. – buzdykg May 16 '15 at 19:29
  • can i use below class to do that. can i override these methods, what is the best practice for laravel 5. Illuminate\Contracts\Auth\Guard; Illuminate\Contracts\Auth\Registrar; Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; – Chanuka Asanka May 16 '15 at 19:54
  • `Hash::make($password)` – user2094178 May 17 '15 at 21:47

0 Answers0