Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.77 KB

SETUP.md

File metadata and controls

45 lines (29 loc) · 1.77 KB

Setup new web platform with this package

The following instructions will guide you through the process of setting up a new web platform using this package, including the installation of Laravel Filament and the required roles and permissions package. They assume you are starting from a fresh Laravel 11 Installation. If you have an existing app, you may need to adapt some of the instructions.

1. Initial setup:

# Install Laravel
laravel new my-app 
### choose none for the 'starter package' ### 



# Change into the new directory + setup
cd my-app
composer require stats4sd/filament-team-management
### this package requires filament and the spatie roles + permissions, so they will be installed as dependencies ###

# Set up the Filament wrapper for the roles and permissions package (https://filamentphp.com/plugins/tharinda-rodrigo-spatie-roles-permissions)
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"

# Set up at least one Filament Panel
php artisan filament:install --panels

2. Run Installation Script

php artisan filament-team-management:install

This will:

  • ask if you want to use 'programs' or not.
  • publish the required migrations
  • add the needed environment variables to your .env and .env.exmaple files (if they don't already exist)
  • optionally run the migrations
  • optionally add the test DB seeders to your DatabaseSeeder.php file

3. Setup Models:

  1. Make sure your App\Models\User model extends the Stats4SD\FilamentTeamManagement\Models\User model
  2. If you want a custom Team and Program model, create them and extend the Stats4SD\FilamentTeamManagement\Models\Team and Stats4SD\FilamentTeamManagement\Models\Program models respectively.
    • Remember to update the .env variables to point to your custom models