The complete public PHP surface of the Darejer package. Anything not listed here is internal — don't depend on it.
Darejer\Http\Controllers\DarejerControllerDarejer\Routing\Route(attribute)Darejer\Routing\RoutePatternDarejer\Screen\ScreenDarejer\Screen\SectionDarejer\Screen\TabDarejer\Forms\FormDarejer\Components\BaseComponentDarejer\Actions\BaseActionDarejer\Components\PermissionGuardDarejer\Navigation\NavigationManagerDarejer\DataGrid\Column/Filter/RowActionDarejer\TreeGrid\TreeColumnDarejer\EditableTable\ColumnDarejer\Kanban\KanbanColumn/KanbanCardDarejer\Concerns\*Darejer\Support\EnumOptions- Helpers
- Console commands
- Service provider
Abstract base controller. Subclasses get auto-routing, JSON envelope helpers, and form publishing. See architecture/controller.md.
| Property | Type | Default | Description |
|---|---|---|---|
$resource |
?string |
null |
URI segment + route-name prefix. |
$routeName |
?string |
$resource |
Override for the route-name prefix. |
$model |
?string |
null |
Eloquent model FQCN for implicit binding. |
$routeMiddleware |
array |
['web', 'auth'] |
Middleware on auto-registered routes. |
$routePrefix |
?string |
null |
Optional URL prefix on top of $resource. |
$parameter |
?string |
Str::singular($resource) |
Route param name. |
$autoRoute |
bool |
true |
Set false to opt out of discovery. |
| Method | Returns | Description |
|---|---|---|
darejerAutoRoute() |
bool |
Read-only accessor for $autoRoute. |
darejerResource() |
?string |
Read-only accessor for $resource. |
darejerRouteName() |
?string |
$routeName ?? $resource. |
darejerModel() |
?string |
Read-only accessor for $model. |
darejerMiddleware() |
array |
Read-only accessor for $routeMiddleware. |
darejerRoutePrefix() |
?string |
Read-only accessor for $routePrefix. |
darejerParameter() |
string |
Resolves $parameter ?? Str::singular($resource ?? 'record'). |
forms() |
array |
Override to expose reusable Form definitions at GET /{resource}/forms/{name}. |
json($data, $status, $meta) |
JsonResponse |
Standard data envelope. |
jsonSuccess($message, $data, $status) |
JsonResponse |
Action acknowledgement. |
jsonError($message, $status, $errors) |
JsonResponse |
Generic error. |
jsonValidation($errors, $message) |
JsonResponse |
422 validation envelope. |
Method attribute for declaring custom non-REST routes on a controller. IS_REPEATABLE.
#[Route('POST', 'bulk/archive', name: 'bulk.archive', middleware: ['can:products.archive'])]
public function bulkArchive(Request $request) { … }| Param | Type | Default | Description |
|---|---|---|---|
method |
string | string[] |
— | HTTP verb(s). |
uri |
string |
— | Path appended under the resource slug. |
name |
?string |
null |
Route name suffix (prefixed with controller's route name). |
middleware |
array |
[] |
Extra middleware. |
absolute |
bool |
false |
If true, uri is registered verbatim (no resource prefix); the name is also not prefixed. |
Helper for generating URL templates with {id} placeholders for RowAction / dialog URL patterns.
| Method | Returns | Description |
|---|---|---|
RoutePattern::row($routeName, $placeholder = '{id}') |
string |
Resolve a registered route and substitute its first parameter with {id} (or another placeholder). |
RoutePattern::for($routeName, $placeholders) |
string |
Multi-parameter variant; pass [paramName => placeholder]. |
RoutePattern::row('products.edit') // → "/products/{id}/edit"
RoutePattern::for('invoices.lines.edit', [
'invoice' => '{invoiceId}',
'line' => '{lineId}',
]) // → "/invoices/{invoiceId}/lines/{lineId}/edit"The screen builder. See architecture/screen-engine.md.
| Method | Returns | Description |
|---|---|---|
Screen::make($title) |
static |
Factory. |
title($title) |
static |
|
record($model|$array|null) |
static |
Bind the record. |
breadcrumbs($crumbs) |
static |
Topbar breadcrumb trail. |
components($components) |
static |
Componentable[]. |
actions($actions) |
static |
Actionable[]. |
sections($sections) |
static |
Section[]. |
tabs($tabs) |
static |
Tab[]. |
dialog($size = 'md') |
static |
Render as modal. Sizes: xs|sm|md|lg|xl|full. |
fullWidth($flag = true) |
static |
|
with($props) |
static |
Merge extra Inertia props. |
toArray() |
array |
Inert payload (mostly for tests). |
render() |
Inertia\Response |
Serialize and render. |
| Method | Returns |
|---|---|
Section::make($title) |
static |
title($title) |
static |
components($names) |
static |
collapsed($flag = true) |
static |
collapsible($flag = true) |
static |
dependOn($rule) |
static |
toArray() |
array |
| Method | Returns |
|---|---|
Tab::make($title) |
static |
title($title) |
static |
components($names) |
static |
dependOn($rule) |
static |
toArray() |
array |
Reusable form definition. Used as a Screen-builder twin and as the source of GET /{resource}/forms/{name}.
| Method | Returns | Description |
|---|---|---|
Form::make($name) |
static |
|
getName() |
string |
|
title($title) |
static |
|
components($components) |
static |
|
record($model|$array|null) |
static |
|
save($url, $method = 'POST', $label = null) |
static |
Add a Save action. |
cancel($url = null, $label = null) |
static |
Add a Cancel action. |
cancelLabel($label) |
static |
Override label only. Pass null to suppress the cancel button. |
addActions($actions) |
static |
Append on top of Save/Cancel. |
actions($actions) |
static |
Replace the entire toolbar. |
tabs($tabs) |
static |
|
sections($sections) |
static |
|
breadcrumbs($crumbs) |
static |
|
with($props) |
static |
|
fullWidth($flag = true) |
static |
|
toArray() |
array |
JSON shape for useHttp consumers. |
renderAsScreen() |
Inertia\Response |
Full Inertia page (the standard create() / edit() experience). |
Abstract base for every component. Concrete components extend this and implement componentType() and componentProps(). The shared API:
| Method | Returns |
|---|---|
static make($name) |
static |
label($label) |
static |
required($flag = true) |
static |
hint($hint) |
static |
tooltip($text) |
static |
default($value) |
static |
fullWidth($flag = true) |
static |
dependOn($field, $value) |
static |
dependOnNot($field, $value) |
static |
dependOnNotEmpty($field) |
static |
dependOnEmpty($field) |
static |
dependOnIn($field, $values) |
static |
dependOnNotIn($field, $values) |
static |
dependOnConditions($conds, $logic = 'and') |
static |
canSee($permission|Closure) |
static |
toArray() |
?array (returns null when hidden) |
Concrete components: see components/README.md.
Abstract base for every action. Concrete actions extend this and implement actionType() and optionally actionProps(). The shared API:
| Method | Returns |
|---|---|
static make($label) |
static |
label($text) |
static |
url($url) |
static |
method($verb) |
static |
dialog() |
static |
canSee($permission|Closure) |
static |
icon($name) |
static |
confirm($message) |
static |
variant($variant) |
static |
disabled($flag = true) |
static |
tooltip($text) |
static |
fullWidth() |
static |
dependOn($field, $value, $operator = 'eq') |
static |
dependOnNotEmpty($field) |
static |
dependOnIn($field, $values) |
static |
dependOnConditions($conds, $logic = 'and') |
static |
toArray() |
?array (returns null when hidden) |
Concrete actions: see actions/README.md.
| Method | Returns |
|---|---|
static make($permission|Closure) |
static |
components($components) |
static |
toArray() |
?array |
See components/permission-guard.md.
The package's sidebar navigation is driven by Darejer\Navigation\NavigationManager. Host apps register NavItem instances in their service provider:
use Darejer\Navigation\NavigationManager;
use Darejer\Navigation\NavItem;
class AppServiceProvider extends ServiceProvider
{
public function boot(NavigationManager $nav): void
{
$nav->add([
NavItem::make('Sales')
->icon('ShoppingCart')
->children([
NavItem::make('Orders')->route('orders.index'),
NavItem::make('Quotations')->route('quotations.index')->canSee('quotations.view'),
]),
NavItem::make('Inventory')
->icon('Package')
->route('products.index')
->badge('New', 'success'),
]);
}
}| Method | Returns |
|---|---|
static make($label) |
static |
icon($icon) |
static |
url($url) |
static |
route($name, ...$params) |
static (URL resolved at render time) |
children($children) |
static |
group($label) |
static |
canSee($permission|Closure) |
static |
badge($text, $color = 'info') |
static |
isVisible() |
bool |
toArray() |
array |
See components/data-grid.md for the full API.
See components/filter-panel.md for the full API.
See components/data-grid.md for the full API.
See components/editable-table.md.
KanbanColumn— seecomponents/kanban.md.KanbanCard— seecomponents/kanban.md.
Eloquent traits for models.
| Trait | Purpose |
|---|---|
HasDarejerPermissions |
Spatie HasRoles + a few extra helpers used by the admin screens. |
HasDarejerTranslatable |
Pair with Spatie's HasTranslations for ergonomic helpers. |
Auditable |
Append-only audit log for model changes. Writes via Darejer\Support\AuditWriter. |
Searchable |
Marks a model for inclusion in the package's global search. The trait expects a searchable() method on the model returning a [field => weight] map. |
Helpers for backed-enum interop. Used internally by SelectComponent, RadioGroup, Combobox, Filter, Display, DataGrid\Column.
| Method | Returns | Description |
|---|---|---|
EnumOptions::labels($enumClassOrArray) |
array<string, string> |
[value => label]. Resolves via label() instance method, static options(), or name fallback. |
EnumOptions::colors($enumClassOrArray) |
array<string, string> |
[value => color]. Resolves via color() instance method or static colors(). |
Globally available functions (autoloaded via composer.json files).
| Function | Description |
|---|---|
__darejer($key, $replace = [], $locale = null) |
Lookup darejer::darejer.{key}. See translations.md. |
| Signature | Class | Description |
|---|---|---|
darejer:install |
Darejer\Console\Commands\InstallCommand |
Interactive setup. |
darejer:language |
Darejer\Console\Commands\LanguageCommand |
Add/remove a language. |
darejer:language:export |
Darejer\Console\Commands\LanguageExportCommand |
Export translations to JSON. |
Darejer\DarejerServiceProvider is auto-discovered. It:
- Merges
config/darejer.php. - Applies Darejer-friendly Fortify defaults (unless
config/fortify.phpis published). - Registers
Gate::before(...)for super-admin bypass. - Publishes config / migrations / Fortify config.
- Auto-loads package migrations.
- Loads package translations from
lang/. - Registers Spatie's Role/Permission models in the
ModelRegistry. - Discovers + registers controllers via
ControllerRouteRegistrar. - Appends
HandleInertiaRequeststo thewebmiddleware group.
Darejer\Providers\FortifyServiceProvider wires Fortify GET views to Inertia pages — see auth/fortify.md.
These exist in the codebase but are not part of the public API. They may change without notice:
Darejer\Routing\ControllerRouteRegistrarDarejer\Data\DataQuery,DataTransformer,ModelRegistryDarejer\Http\Controllers\DataController(use throughdataUrlprops)Darejer\Http\Controllers\Admin\*Darejer\Http\Middleware\HandleInertiaRequestsDarejer\Support\AuditWriter,GlobalSearch,Locales,AlertDarejer\Models\Alert- Anything under
resources/js/— the entire frontend is internal.