Laravel + Sentryã§ç¹å®ã®æ¨©éã ãå¦çãå¤ãã
ã¾ãSentryã§éçºè ã°ã«ã¼ããä½ãããã®éã«'develop' ã«1ãä¸ããã
$developer = Sentry::createGroup([ 'name' => 'developer', 'permissions' => [ 'admin' => 0, 'develop' => 1, ], ]);
次ã«Userããã®ã°ã«ã¼ãã«æå±ããããã®ã¦ã¼ã¶ã§ãã°ã¤ã³ããã
$user = Sentry::createUser([ 'email' => '[email protected]', 'password' => 'password', 'activated' => true, ]); $user->addGroup($developer);
ããã§ãSentry::getUser()->hasAnyAccess(['develop']ãã®çµæã1ã«ãªãã
@if(Sentry::getUser()->hasAnyAccess(['develop'])) <h2>éçºè ç¨ãµã¤ã</h2> @endif