Install via GitHub Template
composer install
./build.php
First Use Case: Package Bootstrapping
build.php script initializes:
src/, config/, tests/).moox.php config, Filament integration hooks).php artisan vendor:publish --provider="YourVendor\YourPackage\YourPackageServiceProvider"
Where to Look First
src/: Core package logic (services, models, contracts).config/moox.php: Package configuration (extend this for customization).build.php: Re-run this to regenerate files after major changes.tests/: Example test structure (use Pest/PHPUnit).Package Development Loop
src/ (e.g., Services/, Contracts/).tests/ with Laravel’s test helpers (e.g., createMock() for contracts).php artisan vendor:publish to expose config/views.build.php or templates in resources/templates/ to update the scaffold.Filament Integration
moox:filament commands (if available) to generate CRUD interfaces.YourPackageServiceProvider::boot():
Filament::serving(function () {
Filament::registerResource(YourResource::class);
});
moox.php config to share settings between your package and Filament apps.Command-Line Automation
build.php to add custom scaffolding. Example:
// Add to build.php
if ($this->option('generate:resource')) {
$this->call('make:filament-resource', ['name' => $this->argument('name')]);
}
console/Kernel.php:
protected $commands = [
Commands\YourCustomCommand::class,
];
Configuration Management
php artisan vendor:publish --tag="moox-config"
config/moox.php:
'your_package' => [
'setting' => env('YOUR_PACKAGE_SETTING', 'default'),
],
config('moox.your_package.setting');
Testing Patterns
PackageServiceProvider for isolated testing:
use Tests\CreatesApplication;
use YourVendor\YourPackage\YourPackageServiceProvider;
class YourPackageTestCase extends TestCase
{
use CreatesApplication;
protected function getPackageProviders($app)
{
return [YourPackageServiceProvider::class];
}
}
$filament = Mockery::mock(Filament::class);
$filament->shouldReceive('registerResource')->once();
Template Overrides
build.php or resources/templates/ after initial generation may break future updates. Tip: Fork the template or document changes.composer.json scripts to customize builds:
"scripts": {
"post-autoload-dump": "php build.php --custom-option"
}
Filament Version Mismatches
composer.json:
"require": {
"filament/filament": "^3.0"
}
Configuration Caching
config/moox.php require cache clearing:
php artisan config:clear
config_cache in config/app.php for development:
'config_cache' => false,
Service Provider Loading Order
Filament::serving) may fail.config/app.php under providers.Build Script Dependencies
build.php may fail if Composer dependencies are missing. Gotcha: Running ./build.php without composer install first.build.php:
if (!file_exists(__DIR__.'/vendor/autoload.php')) {
throw new RuntimeException('Run `composer install` first.');
}
Log Package Events
\Log::info('YourPackage initialized', ['config' => config('moox')]);
storage/logs/laravel.log.Artisan Command Debugging
build.php:
$this->info("Generating files in: {$this->option('path')}");
--verbose:
./build.php --verbose
Filament Debugging
.env:
FILAMENT_DEBUG=true
Custom Templates
vendor/moox/skeleton/resources/templates/ to your project’s resources/templates/.Dynamic Configuration
moox.php:
'api_key' => env('YOUR_PACKAGE_API_KEY'),
boot():
if (empty(config('moox.api_key'))) {
throw new RuntimeException('API key not configured.');
}
Package Discovery
discoverPackages() in composer.json:
"extra": {
"laravel": {
"discover-packages": true
}
}
CI/CD Integration
build script to composer.json:
"scripts": {
"build": "php build.php && php artisan config:cache"
}
composer build
How can I help you explore Laravel packages today?