ahmmed/admin-ancillary

This package will check permission of admin user to control access in admin.

v4.0.1 2022-12-26 16:01 UTC

This package is auto-updated.

Last update: 2024-10-26 20:04:30 UTC


README

Ahmmed/AdminAncillary

Laravel Ahmmed/AdminAncillary check the role based permissions to built in Auth System of Laravel 5. AdminAncillary protects routes and even crud controller methods.

Table of Contents

Requirements

Getting Started

Documentation

Contribution Guidelines

Requirements

This package requires PHP  >=7.0.0

Getting Started

Installation

composer require ahmmed/admin-ancillary

Publish the package migrations,asset and views to your application

php artisan vendor:publish --provider="Ahmmed\AdminAncillary\AdminAncillaryServiceProvider"

After successful publish, Add the role relationship method and user_role fillable field  to your User model.

public function role(){
    return $this->hasOne(Role::class,'id','user_role');
}

and also add below lines into DatabaseSeeder file

$this->call(UserTableSeeder::class);
$this->call(MenuTableSeeder::class);
$this->call(RoleTableSeeder::class);

After that run 

"php artisan migrate" 

and

"php artisan db:seed" 

Add the middleware to your app/Http/Kernel.php.

protected $routeMiddleware = [
'check_permission' => 'Ahmmed\AdminAncillary\CheckPermission',
];

If your application have no error view page then add error view page.

Also add DEFAULT_LOGO and DEFAULT_FAVICON in your .env file for upload logo and favicon in app settings 

Documentation

Follow along the Wiki to find out more.

Contribution Guidelines

Support follows PSR-2 PHP coding standards, and semantic versioning.

Please report any issue you find in the issues page. Pull requests are welcome.