1. Go to this page and download the library: Download adhocrat-io/arkhe-main 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/ */
adhocrat-io / arkhe-main example snippets
use Arkhe\Main\Concerns\HasBackendProfile;
class User extends Authenticatable
{
use HasBackendProfile; // ⚠ already pulls in Spatie's HasRoles — do NOT add `use HasRoles;` separately.
}
'layout' => 'components.layouts.app', // your starter kit layout
use Arkhe\Main\Support\ArkheNav;
ArkheNav::section('settings')->item(
key: 'billing',
label: fn () => __('billing::nav.title'), // closure → resolved at render (locale-aware)
icon: 'credit-card',
route: 'billing.settings',
active: 'billing.settings*', // routeIs pattern(s) for the "current" highlight
can: 'manage-billing', // permission string, closure(?$user): bool, or null
priority: 50, // ordering within the section
);
// config/arkhe.php
'roles' => [
'root' => 'root',
'administrator' => 'administrateur',
'manager' => 'manager', // new role, ranks between admin and user
'user' => 'user',
'guest' => 'guest',
],
use Arkhe\Main\Support\RoleHierarchy;
public function boot(): void
{
RoleHierarchy::register('manager', after: 'administrateur');
RoleHierarchy::register('editor', before: 'user');
RoleHierarchy::register('intern'); // append at the lowest rank
}
use Arkhe\Main\Concerns\HasArkheSeo;
class Post extends Model
{
use HasArkheSeo;
}
'sitemap' => [
'enabled' => env('ARKHE_SITEMAP_ENABLED', true),
'url' => env('ARKHE_SITEMAP_URL'), // null → falls back to config('app.url')
'path' => env('ARKHE_SITEMAP_PATH'), // null → falls back to public_path('sitemap.xml')
'schedule' => env('ARKHE_SITEMAP_SCHEDULE', '0 3 * * *'),
],
// config/arkhe.php
'components' => [
'list-users' => App\Livewire\Admin\Users\AppListUsers::class,
],
// app/Livewire/Admin/Users/AppListUsers.php
class AppListUsers extends \Arkhe\Main\Livewire\ListUsers
{
protected function afterCreate(Model $user, array $payload): void
{
app(NewsletterService::class)->subscribe($user, 'admin');
}
public function resetPassword(int $id): void
{
// extra wire:click target — works because the route already resolves to this class
}
}
bash
php artisan vendor:publish --tag=arkhe-views
# then edit resources/views/vendor/arkhe/partials/sidebar-items.blade.php