PHP code example of snoeren-development / laravel-admin-users
1. Go to this page and download the library: Download snoeren-development/laravel-admin-users library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
snoeren-development / laravel-admin-users example snippets
// Kernel.php
'admin' => \SnoerenDevelopment\AdminUsers\AdminMiddleware::class,
// AuthServiceProvider.php
use Illuminate\Support\Facades\Gate;
public function boot()
{
$this->registerPolicies();
Gate::before(function ($user, $ability) {
if ($user->isAdmin()) {
return true;
}
});
}