This file provides guidance to Claude Code when working in this repository.
Fexend Blade is a Laravel admin template built on fexend-html. It provides a fully functional Laravel starting point with:
- Laravel 12 + Laravel Folio (file-based routing)
- Tailwind CSS v4 via
@tailwindcss/vite— CSS-first config inresources/css/app.css - Alpine.js v3 — All UI interactivity is inline; no separate JS logic files
- Blade Components — Reusable UI components in
resources/views/components/ - Spatie Permissions — Role/permission system
The static source of truth is fexend-html. When porting or syncing, always reference that project.
bun install # Install JS dependencies
bun run dev # Start Vite dev server (watches CSS + JS)
bun run build # Production build
composer install # Install PHP dependencies
php artisan serve # Start PHP dev server
php artisan migrate # Run database migrationsAlways use Bun for JS dependencies — not npm or yarn.
resources/
├── css/
│ ├── app.css # Tailwind entry point + @theme tokens
│ ├── components.css # @import barrel for UI components
│ ├── forms.css # @import barrel for form element CSS
│ ├── layouts.css # @import barrel for layout CSS
│ ├── libs.css # @import barrel for third-party library CSS
│ ├── utilities.css # @import barrel for utility CSS
│ ├── components/ # Per-component CSS (button, card, modal, …)
│ ├── forms/ # Form CSS (input, label, checkbox, radio, switch)
│ ├── layouts/ # Layout CSS (navbar, sidebar, layout, loading)
│ ├── libs/ # Third-party theming (select2, flatpickr, datatable, wysiwyg)
│ └── utilities/ # Utility CSS (a, heading, list, p)
├── js/
│ └── app.js # Alpine.js + plugins entry point
└── views/
├── components/ # Blade components (<x-button>, <x-modal>, …)
│ └── layouts/ # Layout sub-components (header, sidebar, loading, mobile-menu)
├── layouts/ # Base layout files (main.blade.php, blank.blade.php)
├── pages/ # Folio-routed pages
│ ├── component/ # Component showcase pages
│ ├── element/ # Form element showcase pages
│ │ └── forms/ # Form element sub-pages
│ └── pages/ # Auth + app pages (login, register, 404, calendar, …)
├── auth/ # Functional auth pages (login, register, profile, …)
├── master/ # Master data pages (user CRUD)
├── settings/ # Settings pages (roles, permissions)
└── mails/ # Email templates
└── auth/ # Auth emails (verification, reset password)
Every .blade.php under resources/views/pages/ becomes a route automatically. Always add a named route at the top:
<?php
use function Laravel\Folio\name;
name('pages.my-page');
?>File → route mapping:
pages/pages/calendar.blade.php→/pages/pages/calendar→pages.calendarpages/element/datatable.blade.php→/pages/element/datatable→element.datatable
| Layout | Component | Use for |
|---|---|---|
| Main (with sidebar + navbar) | <x-main title="..."> |
Dashboard, data pages, component showcases |
| Blank (full-page, no sidebar) | <x-blank title="..."> |
Auth pages, error pages, email-style pages |
All reusable UI lives in resources/views/components/. Usage syntax:
<x-button class="button-primary">Save</x-button>
<x-modal id="confirm" title="Confirm" size="md">...</x-modal>
<x-input name="email" label="Email" required></x-input>
<x-breadcrumb>
<x-breadcrumb-item :href="route('dashboard')" title="Dashboard"></x-breadcrumb-item>
<x-breadcrumb-item title="Users" active></x-breadcrumb-item>
</x-breadcrumb>- Never use raw hex colors — use
@themetokens (text-primary,bg-danger, etc.) - Always include dark mode variants —
dark:bg-slate-800,dark:text-primary-dark - Never style bare HTML elements (
input,select,textarea,label) — use opt-in classes:.input,.select,.textarea,.label - No inline
<style>blocks unless preventing FOUC in loading screens - Add new component CSS to
resources/css/components/<name>.cssand import incomponents.css - Add new form CSS to
resources/css/forms/<name>.cssand import informs.css
- Alpine.js only — all
x-data,x-show,@click,:class,x-model,x-initstay inline in Blade templates - Page-specific scripts go in
<x-slot name="scripts"><script>...</script></x-slot>inside<x-main> - No separate
.jsfiles for page logic — keep it inline
- Prefer
<x-component>over raw HTML for anything that has a Blade component - Use
route()helper for all internal links — never hardcode paths @csrfrequired in all POST forms{{ Auth::user()->name }}for authenticated user data in real pages; hardcode demo data in showcase pages
# Main layout page
touch resources/views/pages/pages/my-page.blade.php<?php
use function Laravel\Folio\name;
name('pages.my-page');
?>
<x-main title="My Page">
<x-breadcrumb>
<x-breadcrumb-item :href="route('dashboard')" title="Dashboard"></x-breadcrumb-item>
<x-breadcrumb-item title="My Page" active></x-breadcrumb-item>
</x-breadcrumb>
<!-- content here -->
</x-main>touch resources/views/components/my-component.blade.phptouch resources/css/components/my-component.css
# Then add to resources/css/components.css:
echo '@import "./components/my-component.css";' >> resources/css/components.css- Read the source from
fexend-html/src/pages/<name>.html - Strip:
<!doctype>,<head>,<body>attrs, loading screen, navbar, sidebar, mobile menu - Wrap content in
<x-main title="...">or<x-blank title="..."> - Add
<?php use function Laravel\Folio\name; name('...'); ?> - Convert
<ol class="breadcrumb">→<x-breadcrumb>with<x-breadcrumb-item>children - Replace
href="/src/index.html"→href="{{ route('dashboard') }}" - Keep all Alpine.js attributes exactly as-is
- Move page-specific scripts to
<x-slot name="scripts">
The CSS in resources/css/ must stay in sync with fexend-html/src/css/. When syncing:
- Copy files verbatim — no Blade-specific changes needed in CSS
- Run a class-name diff to verify:
diff <(grep -oE '\.[a-z][a-z0-9-]+' src.css | sort -u) <(grep -oE '\.[a-z][a-z0-9-]+' dest.css | sort -u) - Never add CSS that doesn't exist in fexend-html without adding it there first
docker compose up -d # Start PostgreSQL + Redis
docker compose down # Stop servicesDatabase defaults: host 127.0.0.1, port 5432, db/user fexend, password secret.