weward/porticobouncer

This is just a test

v0.0.13 2023-07-24 02:59 UTC

This package is auto-updated.

Last update: 2024-05-24 04:35:54 UTC


README

This also serves as a template

Requirements

  • Install Silber/Bouncer package
    composer require silber/bouncer:^1.0
  • Add HasRolesAndAbilities trait in User.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 HasPorticoBouncerPermissions trait is present in the User.php model

    • Custom models are present in AppServiceProvider.php

        Bouncer::useAbilityModel(\App\Models\Admin\Ability::class);
        Bouncer::useRoleModel(\App\Models\Admin\Role::class);
    
    • The porticobouncer routes were registered in the RouteServiceProvider
    • The 'portico.bouncer' entry exists in thhhe $middlewareAliases array of the Http/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=ability
    • php artisan test --filter=role

OR publish files manually:

  • php artisan vendor:publish --tag=subpackage-middleware if would publish middlewares that came with the package to App\Http\Middleware

  • php artisan vendor:publish --tag=subpackage-controllers if would publish controllers that came with the package to App\Http\Controllers

  • php artisan vendor:publish --tag=subpackage-requests if would publish requests that came with the package to App\Http\Requests

  • php artisan vendor:publish --tag=subpackage-services if would publish services that came with the package to App\Services\Admin

  • php artisan vendor:publish --tag=subpackage-tests if would publish services that came with the package to tests\Feature\Admin

  • php artisan vendor:publish --tag=subpackage-package-routes if would publish routes that came with the package to routes Note: This will also register the route file porticobouncer.php in the app's RouteServiceProvider.php

  • Add Weward\PorticoBouncer\PorticoBouncerServiceProvider::class, to the 'providers' array of the config/app.php file.

Developing and Updating the Package

  • Include PorticoBouncer package 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 PorticoBouncer package
  • 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

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Support us

68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f506f727469636f426f756e6365722e6a70673f743d31

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.