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/
We will get output as follows
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
Note don't forget to register our provider in config/app file
lets register our routes in web.php
Note admin route must be under prefix admin and middleware auth and web
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