Getting Started
Installation
Preface
AuToLoAd is a Laravel package that is used for developing a CMS-controlled website with commonly used features and concepts.
First, you'll need to purchase a License to use Autoload.
in your project.
You can purchase a license from here.
Installation
Once you have purchased a license, you will need to authenticate: you can install the package via composer:
1composer config --auth http-basic.mergeloop-autoload.repo.repman.io token [YOUR_LICENSE_KEY]
Next, add the following to your composer.json
file's repositories section:
1{2 "repositories": [3 {"type": "composer", "url": "https://mergeloop-autoload.repo.repman.io"} 4 ]5}
Finally, you can install the package via composer:
1composer require mergeloop/autoload
Next, edit your User model to include Filament and Spatie Roles:
1use Filament\Models\Contracts\FilamentUser; 2use Filament\Panel; 3use Illuminate\Foundation\Auth\User as Authenticatable; 4use Illuminate\Notifications\Notifiable; 5use Spatie\Permission\Traits\HasRoles; 6 7class User extends Authenticatable implements FilamentUser 8{ 9 use HasRoles; 10 use Notifiable;11 12 public function canAccessPanel(Panel $panel): bool 13 {14 return $this->hasAnyRole(['Super Admin', 'Admin', 'Editor', 'Viewer']);15 }16}
Publish the Autoload and Spatie's Roles & Permission assets files:
1php artisan vendor:publish --provider="Mergeloop\Autoload\AutoloadServiceProvider"2php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
Run the migrations to create the necessary tables:
1php artisan migrate
Then, run the permissions seeder:
1php artisan autoload:seed-permissions
You should add the following to your composer.json
file to always keep Autoload's assets up to date:
1"scripts": {2 "post-autoload-dump": [3 "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",4 "@php artisan package:discover --ansi",5 "@php artisan vendor:publish --provider=\"Mergeloop\\Autoload\\AutoloadServiceProvider\" --tag=public --force", 6 "@php artisan filament:upgrade", 7 "@php artisan vendor:publish --tag=livewire:assets --ansi --force" 8 ]9},
Lastly, run the installation command:
1php artisan autoload:install
It is recommended to ignore these files and directories in your .gitignore
file:
1/public/vendor/livewire2/public/vendor/autoload3/public/page-cache4!/public/page-cache/.gitkeep5/public/css/filament6/public/js/filament7auth.json