function json() { $this->requiring(); $authority = new Authority(); $authorized = $authority->authorize(); if ($authorized !== true) { die('認証に失敗しました。ログインし直してください。'); } else { return $this->execute(); } }
public function run() { DB::table('cms_privileges')->delete(); $admin = Admin::first(); $sections = Section::get(); foreach ($sections as $section) { Authority::authorize($admin)->admin($section); } }