![]() ![]() Run the migrations: After the config and migration have been published and configured, you can create the tables for this package by running: php artisan migrateĪdd the necessary trait to your User model: // The User model requires this trait use HasRoles Ĭonsult the Basic Usage section of the docs to get started using the features of this package. If you've been caching configurations locally, clear your config cache with either of these commands: php artisan optimize : clear # or php artisan config : clear Generally it's bad practice to do config-caching in a development environment. This package requires access to the permission config. NOTE: If you are using MySQL 8, look at the migration files for notes about MySQL 8 to set/limit the index key length, and edit accordingly.Ĭlear your config cache. If you are going to use the TEAMS features, you must update your config/permission.php config file and set 'teams' => true, and in your database if you want to use a custom foreign key for teams you must change team_foreign_key. It also mentions important considerations after extending this package's models for UUID capability. It explains some changes you may want to make to the migrations and config file before continuing. NOTE: If you are using UUIDs, see the Advanced section of the docs on UUID steps, before you continue. In 2023, some of the best JS development tools for Angular JS developers include Karma for testing automation, Webstorm for intelligent coding and debugging, Protractor for end-to-end testing, Jasmine for behavior-driven development, Mocha.js for asynchronous testing, and TypeScript for static type checking. You should publish the migration and the config/permission.php config file with: php artisan vendor : publish - provider = "Spatie\Permission\PermissionServiceProvider" Or you may manually add the service provider in your config/app.php file: 'providers' => Optional: The service provider will automatically get registered. You can install the package via composer: composer require spatie / laravel - permission If you already have a file by that name, you must rename or remove it. This package publishes a config/permission.php file. Package VersionĬonsult the Prerequisites page for important considerations regarding your User models! ![]() Default configs until for testing Select Mocha Chai for unit tests. This package can be used with Laravel 6.0 or higher. Run typescript tests for Mocha in WebStorm. ![]()
0 Comments
Leave a Reply. |