/** * Create a new Admin. * * @param string $name * @param string $email * @return Agency\Cms\Admin */ public function create($name, $email) { $raw = $this->generatePassword(); $password = Hash::make($raw); $admin = $this->admin->create(compact('name', 'email', 'password')); $admin->raw_password = $raw; return $admin; }
public function run() { require base_path() . '/launch/cms.boot.php'; // Create admin account $admin = Admin::create(['name' => 'Mr. Admin', 'email' => '*****@*****.**', 'password' => Hash::make('meh')]); // Grant Admin privileges $sections = Section::all(); Auth::authorize($admin)->admin($sections); }
public function run() { DB::table('cms_privileges')->delete(); $admin = Admin::first(); $sections = Section::get(); foreach ($sections as $section) { Authority::authorize($admin)->admin($section); } }