Opinionated abstract building blocks (controllers, services, repositories, actions, policies, resources) for well-structured Laravel CRUD projects.
al-rahabi/fancy-crud is a Laravel package for opinionated abstract building blocks (controllers, services, repositories, actions, policies, resources) for well-structured laravel crud projects..
It currently has 0 GitHub stars and 2 downloads on Packagist (latest version v0.1.3).
Install it with composer require al-rahabi/fancy-crud.
Discover more Laravel packages by al-rahabi
or browse all Laravel packages to compare alternatives.
Last updated
Abstract building blocks for well-structured Laravel projects: base controllers, services, repositories, CRUD actions, policies, requests, resources, enums, casts and traits.
composer require al-rahabi/fancy-crud
php artisan vendor:publish --tag=fancy-crud-config
| Namespace | Contents |
|---|---|
| FancyCrud\Actions\Crud | AbstractAction, CreateAction, UpdateAction, DestroyAction |
| FancyCrud\Services | BaseService, BaseCrudService |
| FancyCrud\Repositories | BaseRepository |
| FancyCrud\Contracts | Controller, CrudController, BasePolicy, BaseRequest, BaseResource, BaseEnumTrait, BaseNotification |
| FancyCrud\Casts | MediaCast |
| FancyCrud\Traits | Activable, HasSlug, Sortable, ResponseTrait, PaginationMetaTrait |
| FancyCrud\Middleware | AcceptedLanguagesMiddleware |
BaseNotification needs laravel-notification-channels/fcm.
composer install && composer test
The package ships a declarative test generator, FancyCrud\Testing\CrudTestBuilder
(helper: crudTest()), that expands into the standard suite for a CrudController.
InteractsWithCrud on the base test case your CRUD files run on, call
$this->setUpCrud() at the end of setUp(), and implement crudUser(?array $permissions)
(null = may do everything, array = exactly those permissions, e.g. ['index posts']).
Token-based apps override crudHeaders(), crudUnauthedHeaders(), crudRestrictedHeaders();
apps needing an environment (tenant, transaction) override crudSeed().tests/Pest.php: pest()->extend(CrudTestCase::class)->in('Feature/Crud');crudTest('posts')
->model(Post::class)
->all() // or ->only(['index','store',...]) / ->except([...])
->createPayload(['title' => 'Hello'])
->invalidPayload(['title' => ''])
->jsonStructure(['id', 'title'])
->assertCreated(['title' => 'Hello'])
->importRows([['Title'], ['First'], ['Second']]) // for the import verb (CSV upload)
->run();
Verbs: index store show update patch destroy export template import, plus always
401 (unauthenticated) and 403 (no permission; ->restrictedPermission(null) to skip).
Defaults: base URL /api (->baseUrl()), records from Model::factory() (or ->record(fn)).
See tests/ for a complete working example (fixture controller, policy, Excel sheet).
Get paid by clients abroad
Wise gives you local bank details in several currencies and converts at the mid-market rate. Useful when your invoices are not in your own currency.
Try WiseNew Laravel packages worth a look, once a month. No spam, one-click unsubscribe.