weward / porticobouncer
This is just a test
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/weward/porticobouncer
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
This also serves as a template
Requirements
- Install Silber/Bouncer package
composer require silber/bouncer:^1.0
- Add
HasRolesAndAbilitiestrait inUser.php
use Silber\Bouncer\Database\HasRolesAndAbilities; use HasRolesAndAbilities;
- Publish Silber/Bouncer's migration
php artisan vendor:publish --tag="bouncer.migrations"
- Run the migration
php artisan migrate
Installation
-
Submit project via Packagist
-
Composer require weward/porticobounce:^#.#.#
-
composer dump-auto -
php artisan package:discover -
php artisan porticobouncer:install -
Check if the package files were registered properly (If the specified files has these values):
-
Thh
HasPorticoBouncerPermissionstrait is present in theUser.phpmodel -
Custom models are present in
AppServiceProvider.php
Bouncer::useAbilityModel(\App\Models\Admin\Ability::class); Bouncer::useRoleModel(\App\Models\Admin\Role::class);- The
porticobouncerroutes were registered in theRouteServiceProvider - The
'portico.bouncer'entry exists in thhhe $middlewareAliases array of theHttp/Kernel.php - Add Role index route to
resources/js/Properties/navMenu.js
{ label: 'User Roles', route: route('roles.index'), icon: 'mdi-account-star' },
-
-
Run tests
php artisan test --filter=abilityphp artisan test --filter=role
OR publish files manually:
-
php artisan vendor:publish --tag=subpackage-middlewareif would publish middlewares that came with the package toApp\Http\Middleware -
php artisan vendor:publish --tag=subpackage-controllersif would publish controllers that came with the package toApp\Http\Controllers -
php artisan vendor:publish --tag=subpackage-requestsif would publish requests that came with the package toApp\Http\Requests -
php artisan vendor:publish --tag=subpackage-servicesif would publish services that came with the package toApp\Services\Admin -
php artisan vendor:publish --tag=subpackage-testsif would publish services that came with the package totests\Feature\Admin -
php artisan vendor:publish --tag=subpackage-package-routesif would publish routes that came with the package toroutesNote: This will also register the route fileporticobouncer.phpin the app'sRouteServiceProvider.php -
Add
Weward\PorticoBouncer\PorticoBouncerServiceProvider::class,to the'providers'array of theconfig/app.phpfile.
Developing and Updating the Package
- Include
PorticoBouncerpackage folder (dev/Personal/laravel-packages) into the VSCode workspace - Develop, update and test the files in the main project
- Copy over all the updated files into its respective folders in the
PorticoBouncerpackage - Commit the changes to
PorticoBouncer - Add tags to
PorticoBouncer - Update the packagist entry
Creating a new package
-
Use Spatie package-skeleton-laravel to install and configure a new package (+namespace|etc)
-
Copy the ff from Spatie/laravel-package-tools and update the imports in your own package
-
InstallCommand.php -
Package.php -
PackageServiceProvider.php
-
-
If will be creating a new method (publishing files), add the method implementation in the boot() method of Package.php
-
Add the variables in the PackageServiceProvider
-
Call the method in the configurePackage() method of the PackageNameServiceProvider
This is just a test
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require weward/porticobouncer
You can publish and run the migrations with:
php artisan vendor:publish --tag="porticobouncer-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="porticobouncer-config"
This is the contents of the published config file:
return [
];
Optionally, you can publish the views using
php artisan vendor:publish --tag="porticobouncer-views"
Usage
$porticoBouncer = new Weward\PorticoBouncer(); echo $porticoBouncer->echoPhrase('Hello, Weward!');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.