WIP: Made by a Noob ... don't use it V0.01
This package provides simple middleware, a Gate @can('admin-access)
and a migration/ seeder
Add these two lines to the composer.json file of your laravel installation to use the dev version of this package
"minimum-stability": "dev",
"prefer-stable" : true,
Require the package
composer require ridrog/simple-admin
Include the ServiceProvider
to the providers array @ config/app.php
'providers' => [
...
Ridrog\SimpleAdmin\SimpleAdminServiceProvider::class,
...
],
- Install it
- publish and edit config (if needed)
php artisan vendor:publish --tag=adminarea-config
- Migrate
php artisan migrate
- Include der Seeder and Seed (if you want)
$this->call(Ridrog\SimpleAdmin\Database\Seeds\UsersTableSeeder::class);
php artisan db:seed
- Write your routes
With the "admin" middleware - Use the gate
@can('admin-access) // Your Content @endcan
There should be no need the edit the migration, because you can edit both (the tablename and the column) at the config file
You can seed two users
- admin@admin.de : 123456 : is an admin
- user@user.de : 123456 : is no admin
add this to your app's DatabaseSeeder.php
$this->call(Ridrog\Adminarea\Database\Seeds\UsersTableSeeder::class);
run the Seeder
php artisan db:seed