Download the PHP package sadio-sanghare/sonko-patriot-forge without Composer
On this page you can find all versions of the php package sadio-sanghare/sonko-patriot-forge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sadio-sanghare/sonko-patriot-forge
More information about sadio-sanghare/sonko-patriot-forge
Files in sadio-sanghare/sonko-patriot-forge
Package sonko-patriot-forge
Short Description SonkoPatriot Forge - Laravel 13 API and web scaffold generator with modern dashboard, Bootstrap tables or Yajra Laravel DataTables, Data, Query Builder, Permissions, OpenAPI, audit, media, search, Excel, queues and realtime broadcasting
License MIT
Informations about the package sonko-patriot-forge
SonkoPatriot Forge
Modern Laravel 13 API & Module Generator
SonkoPatriot Forge (SPForge) is a Laravel 13 native code generator designed to build production-oriented APIs and CRUD modules with modern Laravel conventions and optional enterprise features.
It can generate Models, migrations, repositories, Form Requests, API controllers, Resources, tests, policies, observers, DTOs, permissions, OpenAPI documentation, activity logs, media handling, full-text search, Excel imports/exports, queues, broadcasts, and notifications from a single Artisan command.
Requirements
- PHP
^8.3 - Laravel / Illuminate
^13.0 - Composer 2
- PHP extensions required by your enabled features, notably
zip,xml,gd,fileinfo,exiffor Excel / Media Library as applicable
Core package integrations:
- Spatie Laravel Data
- Spatie Query Builder
- Spatie Permission
- Spatie Activitylog
- Spatie Media Library
- Laravel Scout
- Laravel Excel
- Laravel Reverb
- Laravel Notifications
- swagger-php / OpenAPI 3
Local installation
For local development, place the package at:
Add a path repository to the application's composer.json:
Install it:
Publish the SPForge configuration:
This creates:
Initialize the generator:
Quick start
Generate a modern API:
Windows CMD:
Field input examples:
html_type is optional. name string is valid and defaults to a text input when scaffold HTML generation needs it.
Enterprise preset
The easiest way to enable the complete v0.6 stack is:
--enterprise enables the main SPForge enterprise capabilities, including Data DTOs, Query Builder, permissions/policy, resources, tests, audit logging, media, Scout search, Excel, queues, broadcasting, notifications and Swagger.
Before using all enterprise integrations, install/publish their infrastructure:
Main Artisan commands
| Command | Description |
|---|---|
spforge:api Model |
Generate a full CRUD API |
spforge:api-scaffold Model |
Generate API + web scaffold |
spforge:scaffold Model |
Generate a web CRUD scaffold |
spforge:model Model |
Generate only the model layer |
spforge:migration Model |
Generate a migration |
spforge:repository Model |
Generate a repository |
spforge:api:controller Model |
Generate only an API controller |
spforge:api:requests Model |
Generate API Form Requests |
spforge:api:tests Model |
Generate API/repository tests |
spforge:scaffold:controller Model |
Generate scaffold controller |
spforge:scaffold:requests Model |
Generate scaffold requests |
spforge:scaffold:views Model |
Generate scaffold views |
spforge:publish |
Initialize API routes/base files |
spforge:publish:user |
Publish the users CRUD scaffold |
spforge:publish:tables datatable\|livewire |
Publish table helper views |
spforge:permissions:install |
Prepare Spatie Permission |
spforge:features:install |
Install/publish optional feature infrastructure |
spforge:web:install |
Install the modern web dashboard, optional native Auth Kit, and choose the scaffold table driver |
spforge:swagger |
Generate OpenAPI JSON/YAML |
spforge:rollback Model api\|scaffold\|api_scaffold |
Remove generated artifacts |
Run:
for the list registered in your application.
Common generator options
The following options are available on the main generator commands derived from the SPForge base command.
Input and database
| Option | Description |
|---|---|
--fieldsFile=FILE |
Load fields from a JSON schema file |
--jsonFromGUI=JSON |
Load generator payload from a JSON string |
--plural=NAME |
Override plural model name |
--table=TABLE |
Override table name |
--fromTable |
Reverse-generate from an existing table |
--ignoreFields=a,b |
Ignore fields when using --fromTable |
--primary=FIELD |
Use a custom primary key |
--connection=NAME |
Use a database connection |
--relations |
Prompt for field relations |
--softDelete |
Enable Eloquent SoftDeletes |
--forceMigrate |
Run generated migration automatically |
Generation control
| Option | Description |
|---|---|
--prefix=PREFIX |
Prefix generated files/names |
--skip=... |
Skip selected generated artifacts |
--views=index,create,... |
Restrict scaffold views |
--factory |
Generate factory |
--seeder |
Generate seeder |
--tests |
Generate API/repository tests |
--resources |
Generate API Resource |
--resourceCollection |
Generate dedicated ResourceCollection |
--policy |
Generate Laravel Policy and bind it via #[UsePolicy] |
--observer |
Generate Observer and bind it via #[ObservedBy] |
--noRepository |
Generate direct Eloquent controller logic |
--noRouteModelBinding |
Disable implicit route model binding |
--noPagination |
Disable index pagination |
--perPage=N |
Default pagination size |
--tableDriver=DRIVER |
Override the web scaffold table driver: bootstrap or yajra-laravel-datatables |
--skipWebCheck |
Allow scaffold generation when using a custom web layout/dashboard |
--noEnumCasts |
Disable generated enum classes/casts |
Yajra Blade generation note
SPForge preserves Yajra runtime expressions such as {!! $dataTable->table(...) !!} and {!! $dataTable->scripts() !!} in the generated Blade view. These expressions are evaluated only when Laravel renders the scaffold page, never while the generator is creating the files.
--skip accepts: migration,model,controllers,api_controller,scaffold_controller,repository,requests,api_requests,scaffold_requests,routes,api_routes,scaffold_routes,views,tests,menu,dump-autoload.
Laravel 13 / API options
| Option | Description |
|---|---|
--middleware=NAME |
Add #[Middleware]; repeatable |
--swagger |
Generate OpenAPI attributes and rebuild specification |
--data |
Generate Laravel Data DTO |
--noData |
Disable DTO generation |
--queryBuilder |
Enable Spatie Query Builder |
--noQueryBuilder |
Disable Query Builder |
--permissions |
Generate CRUD permissions + permission-aware policy |
--permissionGuard=GUARD |
Permission guard, default web |
--enterprise |
Enable the complete v0.6 enterprise preset |
v0.6 feature options
| Option | Description |
|---|---|
--activityLog |
Add Spatie Activitylog to the model |
--media |
Add Media Library and media endpoints |
--mediaCollection=NAME |
Default media collection |
--mediaDisk=DISK |
Media disk |
--searchable |
Add Laravel Scout search support |
--excel |
Generate Excel Import/Export classes and endpoints |
--queue |
Generate queued Excel/realtime jobs where applicable |
--queueConnection=NAME |
Queue connection |
--queueName=NAME |
Queue name |
--broadcast |
Generate Reverb-compatible lifecycle broadcasts |
--broadcastChannelPrefix=PREFIX |
Broadcast channel prefix |
--notifications |
Generate lifecycle Notifications |
--notify=CHANNEL |
Notification channel; repeatable (database, mail, broadcast) |
Feature installer
Install everything:
Or selectively:
Available options:
Permission setup
Dedicated installer:
Options:
--patch-user: addSpatie\Permission\Traits\HasRolestoApp\Models\User--migrate: run migrations--force: overwrite already published Spatie Permission files
Generate permission-aware CRUD:
Generated permissions follow the pattern:
Query Builder
Enabled by default unless disabled in config or with --noQueryBuilder.
Generated APIs can support URLs such as:
Laravel Data
Enabled by default. A DTO such as App\Data\ProductData is generated and used by create/update/resource flows where supported.
Disable it:
Activity Log
The generated model uses LogsActivity and getActivitylogOptions().
Media Library
Typical generated routes include:
Scout search
Typical endpoint:
Configure the Scout driver in config/scout.php / environment variables.
Excel import/export
Typical endpoints:
Queued mode:
On Windows, queued jobs work with supported queue drivers. Laravel Horizon is intentionally optional and is recommended on Linux + Redis, not required by SPForge.
Broadcasting / Reverb
Install broadcasting infrastructure:
Generate lifecycle events:
SPForge can generate Created/Updated/Deleted broadcast events and automatically enable an Observer when lifecycle hooks are required.
Notifications
Database notifications infrastructure can be installed with:
Swagger / OpenAPI
Enable globally:
or per command:
Generate JSON:
Generate YAML:
Custom output:
Default Swagger UI:
Default raw specification route:
The Swagger UI and scan paths are configurable in config/sonkopatriot_forge.php.
Generate from an existing table
Ignore columns:
Schema files
SPForge can save generated field schemas under:
Reuse one:
Rollback
API:
Scaffold:
API + scaffold:
The rollback command removes the generated artifacts enabled by the current SPForge configuration, including Data, policies, observers, permission seeders, Resources, Excel classes, Jobs, broadcast Events and Notifications where applicable.
Important configuration keys
Main configuration file:
Important sections:
path: generated file locationsnamespace: generated namespacesapi_prefixoptions.repository_patternoptions.dataoptions.query_builderoptions.permissionsoptions.activity_logoptions.mediaoptions.searchableoptions.exceloptions.queueoptions.broadcastoptions.notificationsoptions.swaggeroptions.swagger_ui_*options.route_model_bindingoptions.paginationoptions.per_pageoptions.policyoptions.observeroptions.enum_casts
See SONKOPATRIOT_FORGE.md for the exhaustive reference.
Troubleshooting
Clear caches after replacing a local package:
Check installed commands:
Check Swagger routes:
Check package installation:
If Composer reports missing ext-zip, enable PHP ZIP before using Laravel Excel. Do not rely on --ignore-platform-req=ext-zip for production usage.
If Swagger fails because an unrelated application class cannot be loaded, keep swagger_scan_paths restricted to OpenAPI-relevant folders (the package defaults to app/OpenApi, app/Models, app/Http/Controllers/API).
License and attribution
SonkoPatriot Forge is distributed under the MIT license. Historical upstream attribution is retained in LICENSE where required.
Native Laravel 13 Scaffold templates
SonkoPatriot Forge ships its own Bootstrap 5 Blade templates. No AdminLTE template package is required.
The default configuration is:
If an older published configuration still contains adminlte-templates and that namespace is not installed, SPForge automatically falls back to its bundled templates.
Common generated form inputs include text, email, password, number, date, time, datetime-local, url, tel, textarea, select / enum, checkbox, radio and hidden.
For applications that do not have resources/views/layouts/menu.blade.php, automatic menu insertion is skipped without failing scaffold generation.
Modern Web Dashboard Kit and table drivers (v0.8)
Before generating Blade scaffolds, install the reusable SPForge dashboard shell and choose the default table engine.
Bootstrap table driver
This is the lightweight default. Generated list pages use Bootstrap 5 tables rendered by Laravel with Laravel pagination. It does not require a JavaScript DataTables engine.
Yajra Laravel DataTables driver
This activates the Laravel 13 compatible yajra/laravel-datatables:^13.0 server-side driver. Generated scaffolds receive a dedicated App\DataTables\ModelDataTable service, server-side filtering/sorting/pagination, responsive Bootstrap 5 DataTables UI and generated action buttons.
The dashboard installation creates:
resources/views/layouts/app.blade.php;resources/views/layouts/menu.blade.php;- responsive sidebar and topbar partials;
/dashboard, protected byauthby default;- dashboard CSS/JS under
public/vendor/spforge-dashboard; - Chart.js dashboard widgets;
- automatic sidebar items for new scaffolds.
Other installer options:
Configuration:
Per-scaffold override
The generator already uses --table=... for the SQL table name, so web table selection intentionally uses --tableDriver=... on scaffold commands:
This override does not alter the configured default. It only affects the scaffold being generated.
Generated differences
With bootstrap, SPForge generates a normal Blade table and Laravel paginator.
With yajra-laravel-datatables, SPForge additionally generates:
The index controller receives ArticleDataTable and renders server-side results. The generated table partial loads DataTables 2.x + Bootstrap 5 assets only on pages that need them.
Scaffold commands verify that the Web Dashboard Kit is installed before asking for model fields. Projects that already have their own dashboard may bypass the guard with --skipWebCheck.
License and attribution
SonkoPatriot Forge is distributed under the MIT license. The LICENSE file preserves the original InfyOm Labs copyright and adds SonkoPatriot Labs copyright for the modernized fork.
Modern Web Authentication Kit (v0.9)
SonkoPatriot Forge can install a complete web authentication flow without Laravel Breeze, Jetstream, Fortify UI scaffolding, or another frontend starter kit.
Install the dashboard and authentication UI together:
With Yajra Laravel DataTables for future scaffolds:
For applications that require verified email access to the dashboard:
Available authentication installer options:
| Option | Description |
|---|---|
--auth |
Install the SPForge modern authentication kit |
--no-registration |
Do not expose public registration routes/pages |
--no-email-verification |
Install authentication without email verification |
--force |
Overwrite previously generated dashboard/auth files |
--path=dashboard |
Dashboard path and post-auth redirect target |
--middleware=auth,verified |
Dashboard middleware; comma-separated middleware are supported |
The installer generates:
Authentication routes include login/logout, registration, forgot/reset password, password confirmation, email verification and verification resend.
When email verification is enabled, SPForge patches App\Models\User to implement Illuminate\Contracts\Auth\MustVerifyEmail. The patch is designed to handle the commented MustVerifyEmail import shipped by the Laravel skeleton.
Authentication customization
All generated views/controllers are application-owned files, so developers can edit them freely after installation. The visual identity can also be changed without touching the views through config/sonkopatriot_forge.php:
The dashboard branding is independently customizable under web_dashboard.brand_name, web_dashboard.brand_suffix, web_dashboard.logo and web_dashboard.colors.
Social-login buttons are intentionally not generated as fake links. OAuth can be added later using Laravel Socialite without changing the core password/session authentication flow.
Scaffold template rendering safety
SPForge generates Blade source without executing your application layout during generation. Runtime directives such as @extends, @section, and dashboard components are preserved for the generated view and are only evaluated when the application serves the page.
Scaffold field template pack
SonkoPatriot Forge resolves scaffold form inputs from its native template pack:
Supported field templates include text, textarea, select / enum, datetime-local, checkbox, number, email, password, date, time, url, tel, hidden, and radio inputs.
This path is internal to the generator; generated applications do not need to publish these templates unless they want to customize them.
Scaffold field template safety
SPForge uses a two-phase Blade generation strategy for scaffold form controls. Runtime directives such as @error, @checked, @selected, @foreach and runtime {{ ... }} expressions are protected while the generator renders its own templates, then restored in the generated application Blade files. This prevents Laravel from compiling runtime-only directives during code generation.
This applies to all native field templates: text, textarea, select, enum, checkbox, radio, number, date, datetime-local, time, email, password, url, tel, and hidden.
Scaffold field rendering safety (v0.9.4)
SonkoPatriot Forge computes conditional HTML attributes such as required in PHP before rendering scaffold field stubs. Field generator templates do not use inline generator-time @if/@endif directives, preventing Blade double-compilation errors while preserving runtime directives such as @error, @checked, @selected, and @foreach in the generated application views.
Safe scaffold menu generation (v0.9.5)
SPForge no longer renders a Blade template that itself contains nested Blade expressions when adding sidebar entries. Menu items are built directly as final Blade code and wrapped with deterministic markers such as:
When regenerating the same scaffold, SPForge removes a legacy pre-v0.9.5 entry for that model before adding the safe marked version. This repairs malformed nested-Blade menu entries that could cause Unclosed '(' does not match '}' when opening the dashboard.
Route naming (v0.9.6)
Web scaffold routes keep conventional names such as articles.index, while generated API routes always use the api. namespace such as api.articles.index. This prevents Web/API route-name collisions in api-scaffold modules. Scaffold Blade route expressions are emitted only for application runtime, avoiding nested Blade compilation errors.
All versions of sonko-patriot-forge with dependencies
illuminate/bus Version ^13.0
illuminate/console Version ^13.0
illuminate/database Version ^13.0
illuminate/events Version ^13.0
illuminate/filesystem Version ^13.0
illuminate/http Version ^13.0
illuminate/notifications Version ^13.0
illuminate/pagination Version ^13.0
illuminate/queue Version ^13.0
illuminate/routing Version ^13.0
illuminate/support Version ^13.0
illuminate/validation Version ^13.0
illuminate/view Version ^13.0
laracasts/flash Version ^3.2.2
laravel/reverb Version ^1.11
laravel/scout Version ^11.0
maatwebsite/excel Version ^4.0
php Version ^8.3
spatie/laravel-activitylog Version ^4.12
spatie/laravel-data Version ^4.0
spatie/laravel-medialibrary Version ^11.21
spatie/laravel-permission Version ^8.0
spatie/laravel-query-builder Version ^7.0
symfony/var-exporter Version ^7.4 || ^8.0
yajra/laravel-datatables Version ^13.0
zircote/swagger-php Version ^6.7