The magic of creating an Administrator page.
Version | Laravel |
---|---|
v1.0.x | 7.x |
v1.8.* | 8.x |
v2.* | 9.x |
Schema for apps that have a login page for members. You can use laravel/breeze, larave/ui, laravel jetstream, etc.
Now Ladmin comes with the concept of HMVC (Hierarchical Model View Controller) . Click here for more details.
$ php artisan module:make-menu PostMenu --module=Blog
Follow the steps below to get started faster! Add the repository by running the command below.
$ composer require hexters/ladmin
Follow the installation with the --with-admin-table
option.
$ php artisan ladmin:install --with-admin-table
Run migrate and seed, to install ladmin database tables
$ php artisan migrate --seed
And run seeder ladmin module, to assign role and permission to existing user.
$ php artisan module:seed Ladmin
Installation is complete, please access http://localhost:8000/administrator
If you want to use the App\Models\User
model class as a login account, then follow the steps below.
Use \Hexters\Ladmin\LadminAccount
into model \App\Modules\User
see the example.
. . .
use Hexters\Ladmin\LadminAccount;
class User extends Authenticatable {
use HasApiTokens, HasFactory, Notifiable, LadminAccount;
. . .
Open file \Database\Seeders\DatabaseSeeder
, add the code below or you can create your own seeder file.
\App\Models\User::factory(10)->create();
Follow the installation below.
$ php artisan ladmin:install
Run migrate and seed, to install ladmin database tables
$ php artisan migrate --seed
And run seeder ladmin module, to assign role and permission to existing user.
$ php artisan module:seed Ladmin
And please access http://localhost:8000/administrator
To call view
, language
, config
, and component
file, you need to add the prefix of module's name eg blog
, see example below.
Calling View:
view('blog::article.index');
Calling Lang:
__('blog::error.auth.message');
trans('blog::error.auth.message');
Lang::get('blog::error.auth.message');
Calling Config:
config('blog.name')
For component view, if you have component named \Modules\Blog\View\Components\Input
class, then the way to call it by running.
<x-blog-input />
Follow the documentation to view complete slots
and stacks
in layout component Documentation Layout
<x-ladmin-auth-layout>
<x-slot name="title">Page Title</x-slot>
<!-- Follow guest layout for slots & stacks -->
</x-ladmin-auth-layout>
Get modules & template collections in Ladmin Awesome
View complete Documentation here