larajax / amber
A sample Laravel application demonstrating the larajax/ui form, list and UI tools.
Requires
- php: ^8.3
- larajax/larajax: ^3.0
- larajax/ui: dev-main
- laravel/framework: ^13.8
- laravel/tinker: ^3.0
- october/rain: ^4.4
Requires (Dev)
- fakerphp/faker: ^1.23
- laravel/pail: ^1.2.5
- laravel/pint: ^1.27
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.6
- phpunit/phpunit: ^12.5.12
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The demo app for Larajax UI (larajax/ui),
the form, list and UI tools for Laravel. Every example in the documentation runs here, beside the code
that renders it. No JavaScript framework, no build step.
Quickstart
git clone https://github.com/larajax/amber.git cd amber # Install dependencies, copy .env, generate a key, create the SQLite # database, run migrations + seeders and link public/storage. composer setup # Serve the app. There is no build step; assets load from a CDN and the # published vendor/larajax files. composer dev
Then open http://localhost:8000/reference.
The seeder creates five user groups and fifty users (each wired to a primary and secondary groups)
plus a stable demo@example.com account, and a blog of thirty posts written by the first six users.
The default password for every seeded user is
password.
Requirements
- PHP 8.3+
- Composer
- SQLite (default), or any database Laravel supports
Manual setup
If you prefer to run the steps yourself:
composer install cp .env.example .env php artisan key:generate touch database/database.sqlite php artisan migrate --seed php artisan storage:link php artisan serve
What's inside
- Reference (
/reference) has one page for every part of the library, each example running beside the YAML or Blade that renders it, where you can change it and save it. The pages are listed inconfig/reference.php, and each one links to its page on ui.larajax.org. - Showcase is a small blog that puts the pieces together on plain Eloquent models: the posts,
categories, tags and groups, and Laravel's stock
Usermodel as the authors. Each screen has a guide that walks through its code:
| Screen | URL | What it shows | Guide |
|---|---|---|---|
| Dashboard | /dashboard |
Scoreboard with a status pie, a trend against the month before, sparklines, an icon tile and a goal meter; line and bar charts; a status list; a short List of the most read posts | Scoreboards |
| Posts | /posts |
Toolbar with a quick post popup and bulk actions, Filter, List with a setup popup | Building a List Page |
| Create / edit post | /posts/create, /posts/{id}/edit |
Form with tabs, relations to the category, author and tags, an image upload held until the post saves | Building a Form Page |
| Categories | /categories |
ListStructure as a tree with checkboxes, nested and reordered by dragging, with a bulk delete | A tree of records |
| Authors | /authors |
Filter, List with a post count, bulk delete, on Laravel's stock User model |
Models |
| Create / edit author | /authors/create, /authors/{id}/edit |
Form with relations to the groups, validated in the controller, under a scoreboard of the author's figures | Validation |
| Groups | /groups |
List whose rows edit the group in a popup | Editing rows in a popup |
The widget definitions live in resources/ui and the controllers that build them in
app/Controllers.
Tests
composer test
The suite covers every Reference page and Showcase screen. tests/Feature/Reference/CoverageTest.php
fails when a part of the library has no Reference page, and tests/Feature/Reference/DocsTest.php
keeps the docs in step: a docs page for every Reference page, a docs section for every example, and
every code sample in the docs imported from a file that exists here.
Documentation
The documentation site lives in docs/ and is published at
ui.larajax.org. Its code samples are imported from this app's files, so the
docs always show the code the demo runs and the tests cover. See docs/README.md to
build it.
License
MIT