1. Go to this page and download the library: Download nasirkhan/laravel-admin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nasirkhan / laravel-admin example snippets
return [
// Brand name shown in the sidebar and browser tab
'name' => env('APP_NAME', 'Admin'),
// Optional logo path relative to public/ (null = text brand)
'logo' => null,
// Default theme: 'system' | 'light' | 'dark'
'theme' => 'system',
// Fallback navigation when no dynamic menu (module-manager) is available
'nav' => [
[
'label' => 'Dashboard',
'route' => 'backend.dashboard',
'icon' => 'home',
'children' => [],
],
[
'label' => 'Users',
'route' => 'backend.users.index',
'icon' => 'users',
'children' => [],
],
[
'label' => 'Roles',
'route' => 'backend.roles.index',
'icon' => 'shield',
'children' => [],
],
[
'label' => 'Notifications',
'route' => 'backend.notifications.index',
'icon' => 'bell',
'children' => [],
],
],
];
// In your AppServiceProvider::boot()
\Livewire\Livewire::component('backend.users-index', \App\Livewire\Admin\UsersIndex::class);
// app/Livewire/Admin/AdminDashboard.php
namespace App\Livewire\Admin;
use Nasirkhan\Admin\Livewire\AdminDashboard as BaseAdminDashboard;
class AdminDashboard extends BaseAdminDashboard
{
public int $commentsCount;
public function mount(): void
{
parent::mount(); // keeps the existing counts
$this->commentsCount = \App\Models\Comment::count();
}
}
// app/Providers/AppServiceProvider.php
use Livewire\Livewire;
public function boot(): void
{
Livewire::component('admin.dashboard', \App\Livewire\Admin\AdminDashboard::class);
}