swarakaka/darejer
Composer 安装命令:
composer require swarakaka/darejer
包简介
Darejer — Laravel admin platform package. Write only PHP, get a complete enterprise frontend powered by Vue 3, Inertia v3, shadcn-vue, and Tailwind CSS v4.
README 文档
README
Write only PHP. Get a complete enterprise frontend.
Darejer is a Laravel package that lets you build full-featured admin screens, CRUD interfaces, dashboards, and ERP/CRM modules entirely in PHP — no Vue, no JavaScript, no frontend work.
The package serializes your PHP screen definitions to Inertia page props, which are rendered by a set of pre-built Vue 3 components powered by shadcn-vue, Tailwind CSS v4, and Inertia v3.
Features
- Auth out of the box — Laravel Fortify wired to Inertia pages (login, forgot/reset password, 2FA challenge, email verification, confirm password)
DarejerControllerbase — controllers extend one class; REST routes auto-register,#[Route]attribute for custom endpoints, standard JSON envelope helpers — nothing to add toroutes/web.php- Screen engine — define pages, forms, and actions entirely in PHP
- 37 built-in components — DataGrid, Kanban, TreeGrid, Gantt, Scheduler, Diagram, RichTextEditor, Signature, Repeater, Combobox, FilterPanel, Pagination, FileUpload, DatePicker, TimePicker, TagsInput, KeyValueEditor, EditableTable, InPlaceEditor, PDFViewer, Money, TextInput, Textarea, SelectComponent, CheckboxComponent, CheckboxList, RadioGroup, Toggle, TranslatableInput, TranslatableTextarea, Display, Icon, TooltipComponent, BreadcrumbsComponent, Navigation, Table, PermissionGuard
- FastTab layout — collapsible accordion sections like Microsoft Dynamics 365
- Translatable fields — Spatie Translatable integration with multi-language UI
- Permission system — Spatie Permissions with super-admin bypass and
canSee()on every component - DataTable — server-side pagination, sorting, filtering from a single PHP class
- Form system — Inertia v3
useForm, validation errors, file uploads, dirty state - dependOn — conditional component visibility with 11 operators + cascading reset
- Navigation — PHP-defined sidebar nav with groups, badges, icons, flyout panels
- Dialog mode — any screen can open as a modal dialog
Requirements
| Dependency | Version |
|---|---|
| PHP | ^8.4 |
| Laravel | ^13.0 |
| Node.js | ^20 |
| Inertia Laravel | ^3.0 |
| Laravel Fortify | ^1.28 |
| Spatie Permissions | ^6.0 |
| Spatie Translatable | ^6.0 |
Installation
Inside an existing Laravel 13 application:
composer require swarakaka/darejer php artisan darejer:install
The install command publishes the config, assets, and Fortify views, runs the required migrations, and wires Darejer's frontend into your host app.
After installing, build the frontend:
npm install npm run dev
See the installation guide for the full Vite config and entry point snippets.
Quick start
use Darejer\Screen\Screen; use Darejer\Screen\Section; use Darejer\Components\TranslatableInput; use Darejer\Components\SelectComponent; use Darejer\Actions\SaveAction; use Darejer\Actions\CancelAction; public function create(): Response { return Screen::make('New Product') ->sections([ Section::make('general') ->title(__darejer('General')) ->components(['name', 'category', 'status']), ]) ->components([ TranslatableInput::make('name') ->label('Product Name') ->required(), SelectComponent::make('category') ->label('Category') ->options(['furniture' => 'Furniture', 'electronics' => 'Electronics']), ]) ->actions([ SaveAction::make()->url(route('products.store')), CancelAction::make()->url(route('products.index')), ]) ->render(); }
Layout — sections and tabs
Screens organize fields with two fluent layout primitives. Both accept arrays of class instances — never raw arrays.
Section::make($key) — vertical, FastTab-style accordion groups. Sections can be collapsible, start collapsed, and toggle visibility via dependOn().
use Darejer\Screen\Section; Screen::make(__darejer('Edit User')) ->sections([ Section::make('identity') ->title(__darejer('Identity')) ->components(['username', 'email']), Section::make('password') ->title(__darejer('Password')) ->collapsible() ->collapsed() ->components(['password', 'password_confirmation']), Section::make('access') ->title(__darejer('Access')) ->dependOn(['field' => 'role', 'operator' => 'in', 'value' => ['admin', 'manager']]) ->components(['role_ids', 'permission_ids']), ]) ->components([/* ... */]) ->render();
Tab::make($title) — horizontal tab bar above the form body, with each tab showing its own components. Pass ->name('stable-id') if you need the active tab to survive a locale switch (otherwise a stable id is auto-derived from the components list).
use Darejer\Screen\Tab; Screen::make(__darejer('Edit Product')) ->tabs([ Tab::make(__darejer('General')) ->name('general') ->components(['name', 'slug', 'category_id']), Tab::make(__darejer('Pricing')) ->name('pricing') ->components(['price', 'cost', 'tax_rate']), Tab::make(__darejer('SEO')) ->name('seo') ->dependOn(['field' => 'is_published', 'operator' => '=', 'value' => true]) ->components(['meta_title', 'meta_description']), ]) ->components([/* ... */]) ->render();
sections() and tabs() are independent — pick whichever fits the screen. The component definitions in ->components([...]) are referenced from sections/tabs by their name.
Documentation
The package ships with a docs/ folder — your reference for everything that doesn't fit in this README. Start with docs/README.md for the table of contents, then dive into the section you need:
| Folder | What's inside |
|---|---|
docs/getting-started/ |
Installation, configuration, your first screen |
docs/architecture/ |
DarejerController base, Screen engine, JSON envelope, HTTP rules |
docs/components/ |
Reference page for every component (DataGrid, Kanban, Combobox, RichTextEditor, …) |
docs/actions/ |
Save, Cancel, Delete, Button, Link, Dropdown, ModalToggle, BulkAction |
docs/auth/ |
Laravel Fortify integration and customization |
docs/api-reference/ |
Full PHP API surface (Screen, Section, Tab, components, actions) |
docs/permissions.md |
Spatie Permissions wiring, roles, canSee() |
docs/translations.md |
darejer.php languages config, __darejer() helper, model translations |
docs/CHANGELOG.md / docs/CONTRIBUTING.md |
Release history and contribution guide |
Everything in the docs is kept in sync with the source — when in doubt, the docs reflect the current behavior of the package.
Local development
Darejer is consumed as a Composer package, so the recommended workflow is to develop the package against a small Laravel app on your own machine — set up whatever playground you prefer.
1. Clone the package
git clone https://github.com/swarakaka/darejer.git
cd darejer
composer install
npm install
2. Create a local Laravel playground
Spin up a fresh Laravel app anywhere on your machine — this is your private sandbox, not part of the package:
composer create-project laravel/laravel my-playground
cd my-playground
3. Link the package via Composer path repository
Edit the playground's composer.json and point it at your local clone of Darejer:
{
"repositories": [
{
"type": "path",
"url": "../darejer",
"options": { "symlink": true }
}
],
"minimum-stability": "dev",
"prefer-stable": true
}
Then require the package and run the installer:
composer require swarakaka/darejer:@dev php artisan key:generate php artisan darejer:install php artisan migrate --seed
4. Run it
npm install npm run dev php artisan serve
With symlink: true, any change you make inside the darejer/ package is immediately reflected in your playground — no re-install needed. Frontend source under darejer/resources/js and darejer/resources/css is consumed live through the package's Vite plugin (darejer/vite), which aliases @darejer to the package's resources/js. Edits hot-reload via npm run dev — no publish or rebuild step is required.
Contributing
Issues and pull requests are welcome at github.com/swarakaka/darejer.
License
MIT — see the LICENSE file.
swarakaka/darejer 适用场景与选型建议
swarakaka/darejer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 68 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「crud」 「laravel」 「ERP」 「vue」 「inertia」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 swarakaka/darejer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 swarakaka/darejer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 swarakaka/darejer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Gii Generator for double model generation
2lenet/EasyAdminPlusBundle
Analysis module for finding problematical shop data.
A PSR-7 compatible library for making CRUD API endpoints
Admin panel generator for Laravel 8 and based on Vuetify Admin, a separate SPA admin framework running on top of REST APIs.
Collection of tools to use the full power of the Enyalius framework
统计信息
- 总下载量: 68
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 49
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-19