Installation:
composer require maxolex/scaffold-interface laravel/ui "^3.0" spatie/laravel-permission amranidev/ajaxis
npm install && npm run dev
Add providers to config/app.php:
Maxolex\ScaffoldInterface\ScaffoldInterfaceServiceProvider::class,
Amranidev\Ajaxis\AjaxisServiceProvider::class,
Spatie\Permission\PermissionServiceProvider::class,
Publish Assets:
php artisan vendor:publish --provider="Maxolex\ScaffoldInterface\ScaffoldInterfaceServiceProvider" --force
Run Migrations:
php artisan migrate
Access the Interface:
Navigate to /scaffold in your browser. Authenticate using the default admin credentials (password: admin).
Design the Table:
name, email) with types (e.g., string, email).Generate:
app/Models/YourModel.php),database/migrations/..._create_your_models_table.php),app/Http/Controllers/YourModelController.php),resources/views/your_model/...),routes/web.php),Test:
/your-model to see the generated CRUD interface.Design-First Approach:
OneToMany, ManyToMany) via the graph tool.Post model with a ManyToMany relationship to Tag. The package auto-generates:
Reusable Templates:
resources/views/vendor/scaffold-interface/.Package Integration:
lpackager) by pointing the scaffold to the package’s config path:
// In the interface, specify:
'package_path' => base_path('vendor/your-package'),
AdminLTE Dashboard:
resources/views/layouts/admin.blade.php to customize the sidebar.WebSocket Notifications:
.env:
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=your_app_id
PUSHER_APP_KEY=your_key
PUSHER_APP_SECRET=your_secret
Seeding Data: Use the interface to generate a seeder alongside the model. Example:
// Auto-generated in database/seeds/YourModelTableSeeder.php
public function run()
{
YourModel::create(['name' => 'Test', 'email' => '[email protected]']);
}
Run with:
php artisan db:seed --class=YourModelTableSeeder
Rollback: Use the interface’s "Annuler" (Rollback) button to revert migrations/views. Alternatively, manually:
php artisan migrate:rollback
Soft Deletes: Enable in the interface for models. The package adds:
use Illuminate\Database\Eloquent\SoftDeletes;
protected $dates = ['deleted_at'];
And configures the controller to handle soft deletes.
Permissions:
Integrate with spatie/laravel-permission via the interface. Assign roles to generated CRUDs in the AdminLTE users management panel.
French Documentation:
Namespace Conflicts:
App\Models\), ensure the scaffold respects them. Override the default namespace in the interface’s advanced settings.AdminLTE Overrides:
resources/views/layouts/admin.blade.php) may break auto-generated menus. Use:
@include('scaffold-interface::partials.admin-menu')
To re-integrate scaffolded items.WebSocket Dependencies:
.env configuration. Without it, WebSocket features (e.g., live updates) will fail silently.Migration Rollback Issues:
app/Http/Controllers/
resources/views/
routes/web.php
Logs:
storage/logs/laravel.log for scaffold-related errors (e.g., permission issues, missing dependencies).Artisan Commands:
php artisan scaffold:list to see all generated scaffolds.php artisan scaffold:rollback [name] to revert a specific scaffold.View Overrides:
resources/views/vendor/scaffold-interface/
resources/views/vendor/scaffold-interface/partials/form.blade.php to your project and modify.Custom Field Types:
php artisan vendor:publish --tag=scaffold-config
config/scaffold-interface.php to add custom field options (e.g., enum, json).Hooks:
AppServiceProvider:
use Maxolex\ScaffoldInterface\Events\ScaffoldGenerated;
public function boot()
{
event(ScaffoldGenerated::class, function ($event) {
// Post-generation logic (e.g., seed data, send notifications)
});
}
Relationship Macros:
use Maxolex\ScaffoldInterface\Managers\RelationshipManager;
RelationshipManager::macro('customRelation', function ($model, $relation) {
// Custom logic for unsupported relationships
});
Testing:
public function test_crud_operations()
{
$response = $this->get('/your-model/create');
$response->assertStatus(200);
}
How can I help you explore Laravel packages today?