Example Walkthrough
Lets see what's it like to work with adminetic admin panel
In this walkthrough we will make quotes module using super powers of adminetic admin panel
Let's get started
Lets make quotes module using crud generator/
php artisan make:crud Quote --aclWe will get output as follows
Controller created successfully ... β
Model created successfully ... β
Index file created successfully ... β
Create file created successfully ... β
Edit file created successfully ... β
Show file created successfully ... β
Edit add extended file created successfully ... β
Script file created successfully ... β
Migration file created named create_quotes_table ... β
Seeder file created ... β
Repository and Interface created ... β
Request file created ... β
ACL created ... β
CRUD made for model Quote ... β
So what did adminetic admin panel generated for us ?
Quote Model on app/Models/Admin/Quote.
Quote Controller on app/Http/Controllers/Admin/QuoteController
Index, Edit, Create and Show blade views in resources/views/admin/quote folder
edit_add and script layout blade file in resources/views/admin/layouts/module/quote folder
create_quotes_table in database/migrations folder
QuotesSeeder file in database/seeder folder
QuoteRepository class in app/Repositories filder
QuoteInterface interface in app/Contracts
QuoteRequest in app/Http/Requests folder
QuotePolicy in app/Policies folder
Permission Generation for Quote module
lets hookup our quote module
Go to our AdminServiceProvider in app/Providers folder and bind quote interface and repository in repos method in our provider
lets register our routes in web.php
Lets create out database schema
In our database/migrations folder go to our newly created migration create_quotes_table
Lets migrate our schema
Lets work on validating our requests in app/Htpp/Requests/QuoteRequest.php
Lets create our form in admin/layouts/module/quote/editadd_blade.php
here edit_add view acts as a extends view form for both create and edit view. so <x-admientic-edit-add-button :model="$quote ?? null" name="Quote" /> componen is used as a submit button that works for both form.. Instead of edit-add-button component you can also use
Lets register our route to menu. In app/Services/MyMenu.php on myMenu method add folowing to array
Hurray our quote module is complete.
What are the advantages ?
BREAD ACL is made
Repository Pattern Architecture Followed
Consistent Coding
Query Caching enabled ...
Last updated
Was this helpful?