incraigulous / adminzone
Administration panel for Laravel.
Requires
- ext-json: *
- bentools/querystring: ^1.0
- davejamesmiller/laravel-breadcrumbs: 5.x
- fzaninotto/faker: ^1.8
- illuminate/support: ^5.7
- incraigulous/objection: 1.0.1
- jeffochoa/validator-factory: ^1.0
- nicolaslopezj/searchable: ^1.10
- spatie/laravel-blade-x: ^2.1
- spatie/laravel-translatable: ^3.1
- tightenco/ziggy: ^0.6.9
Requires (Dev)
- helmich/phpunit-json-assert: ^2.0
- incraigulous/data-factories: ^1.0
- mockery/mockery: ^1.2
- orchestra/testbench: ^3.7
- orchestra/testbench-browser-kit: ^3.7
- phpunit/phpunit: ^7.4
- rappasoft/laravel-helpers: ^1.0
- dev-master
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/css-what-2.1.3
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/ajv-6.12.6
- dev-dependabot/npm_and_yarn/tar-4.4.19
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/composer/league/flysystem-1.1.4
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/browserslist-4.16.6
- dev-dependabot/npm_and_yarn/chart.js-2.9.4
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/ssri-6.0.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/acorn-5.7.4
- dev-dependabot/composer/symfony/http-foundation-4.4.1
This package is auto-updated.
Last update: 2024-10-30 01:48:21 UTC
README
A powerful admin generator for Laravel.
Getting started
composer require incraigulous/adminzone
publishing vendor resources
php artisan vendor:publish --provider="Incraigulous\AdminZone\AdminZoneServiceProvider" --tag=config
Available tags:
config
: publishes the config file to config/adminzone.php
assets
: publishes all assets including scss, js and views.
scss
: publishes scss to vendor/adminzone/scss
js
: publishes js to vendor/adminzone/js
views
: publishes views to views/vendor/adminzone
public
: publishes compiled assets to public/vendor/adminzone
You can publish as much or as as you like. I recommended that you publish as little as possible to ensure comparability with future updates. Minor release should not introduce breaking changes, but If you choose to override views you should consider locking adminzone to the current release to ensure compatibility.
Creating your first resource
- Create a folder at
app/resources
- Make a
app/resources/User.php
file that contains theExample Resource
code below. - Register your resource in
config.adminzone
by adding\App\Resources\User::class
to the menu array. - After you've created your resource, it will be available in the left sidebar of the admin. This is the minimum level of customization needed to add basic CRUD functionality for a model.
Resources
Example resource
<?php namespace App\Resources; use Incraigulous\AdminZone\Resources\Resource; class User extends Resource { public function columns(): array { return [ 'ID' => 'id', 'Name' => 'name', 'email' => function ($user) { return "<a href='mailto:$user->email' title='Email $user->name'>$user->email</a>"; }, 'Created' => function($model) { return $model->created_at->format('M d Y'); }, ]; } public function fields(): array { return [ 'ID' => 'id', 'Name' => 'name', 'email' => function ($user) { return "<a href='mailto:$user->email' title='Email $user->name'>$user->email</a>"; } ]; } public function model() { return new \App\User(); } }
Models
Any model managed by the Admin use use the Incraigulous\AdminZone\Models\Traits\Administratable
trait or extend Incraigulous\AdminZone\Models\Model
.
Fields
Fields are objects that can be added to forms to build up a form view and specify how submissions should be handled.
Relationships
Relationships user interfaces can easily be added through the use of relationship fields.
Note: You must add an order
int field to pivot tables to allow adminzone to control sort order.
Relationship Fieids
BelongsToField
The belongs to field adds a field to a form that handles a belongs to resource. It will generate a field that allows the user to select and edit the related resource.
protected function main(SectionInterface $main): SectionInterface { $main->field(TextField::create('Email')) ->$main->field(BelongsToField::create('User')->relatedTo(User::class)); return $main; }
BelongsToManyField
The belongs to many field adds a field to a form that handles a belongs to many resources. It will generate a field that allows the user to select and edit the related resource.
protected function main(SectionInterface $main): SectionInterface { $main->field(TextField::create('Post Title')) $main->field(RichTextField::create('Content')) ->$main->field(BelongsToManyField::create('Author')->relatedTo(Author::class)); return $main; }