Overview
Dashboard Laravel uses Blade, Laravel’s powerful templating engine. Blade provides template inheritance, component composition, and clean syntax for displaying dynamic data.All views are located in
resources/views/ with the .blade.php extension.View Structure
The application includes 13 Blade template files:Template Inheritance
Blade uses a parent-child inheritance pattern:Layout Templates
Parent templates define structure and common elements
Content Views
Child views extend layouts and fill content sections
Blade Directives
@extends - Inherit Layout
@extends - Inherit Layout
Specify which layout template to extend:This tells Blade that the view inherits from the specified layout.
@section - Define Content
@section - Define Content
Define content for a specific section:Short syntax for simple values:
@yield - Display Section
@yield - Display Section
In layout templates, define where child content appears:Second parameter is the default value if section is not defined.
Layout Templates
app.blade.php - Main Dashboard Layout
Location:resources/views/layouts/app.blade.php
The primary layout for authenticated dashboard pages with navigation and sidebar.
app.blade.php Features
app.blade.php Features
Layout Structure:
- Top navigation bar with brand and main menu
- Left sidebar with dashboard navigation
- Main content area (9/10 columns wide)
- Responsive design with Bootstrap 5
- Dashboard (Inicio)
- Estadísticas
- Usuarios (Clientes)
- Nosotros
- Configuración
- Home link
- Dashboard
- Análisis
- Ventas
- Clientes
- Facturas
- Mensajes
- Nosotros
- Bootstrap 5.3.8 CSS & JS
- Font Awesome 6.0.0 icons
- Chart.js for data visualization
- Custom
dashboard.cssstylesheet
@yield('title')- Page title@yield('styles')- Additional CSS@yield('nav_*')- Active nav indicator@yield('side_*')- Active sidebar indicator@yield('content')- Main content@yield('scripts')- Additional JavaScript
auth.blade.php - Authentication Layout
Location:resources/views/layouts/auth.blade.php
Minimal layout for login and registration pages.
auth.blade.php Features
auth.blade.php Features
Purpose: Clean, minimal layout for authentication screens.Structure:
- No navigation bars
- Full-width content area
- Essential libraries only
- Login page (
home.blade.php) - Registration page
- Password reset pages
- Any guest-only pages
@yield('title')- Page title@yield('styles')- Additional CSS@yield('content')- Full content@yield('scripts')- Additional JavaScript
View Pages
home.blade.php - Login Page
Location:resources/views/home.blade.php
Authentication page with login and registration tabs.
home.blade.php Features
home.blade.php Features
Layout: Split-screen design (desktop) with left brand panel and right form panel.Left Panel:Success Messages:CSRF Protection:All forms include CSRF token for security.Route Generation:
- Brand logo and tagline
- Decorative feature cards showing metrics
- Visual appeal with icons and statistics
- Tabbed interface (Login / Register)
- Login form with email, password, remember me
- Registration form with name, email, password, confirmation
welcome.blade.php - Dashboard Home
Location:resources/views/welcome.blade.php
Main dashboard page with statistics and charts.
welcome.blade.php Features
welcome.blade.php Features
Dashboard Elements:Highlights dashboard in both top nav and sidebar.Chart Integration:
Uses Chart.js in the
- Page header with action buttons
- 4 statistics cards (Usuarios, Ventas, Crecimiento, Alertas)
- Sales chart using Chart.js
- Recent activity feed
- Data table with recent records
@section('scripts') to render line chart.Responsive Design:- Cards stack on mobile
- Chart adjusts to container width
- Table scrolls horizontally if needed
All View Pages
clientes.blade.php
Client management interface with data table
ventas.blade.php
Sales tracking and order management
facturas.blade.php
Invoice list and payment tracking
mensajes.blade.php
Message center for customer communications
estadisticas.blade.php
Statistics and metrics dashboard
analisis.blade.php
Analytics and data insights
configuracion.blade.php
Application settings and preferences
nosotros.blade.php
About page with company information
signup.blade.php
Registration page (alternative view)
Blade Syntax Features
Displaying Data
Control Structures
Conditionals
Conditionals
Loops
Loops
Form Helpers
Error Handling
Session Messages
Asset Management
Including Assets
External Libraries
The application uses CDN-hosted libraries:- Bootstrap 5.3.8 - UI framework
- Font Awesome 6.0.0 - Icons
- Chart.js - Data visualization
View Organization Best Practices
Layouts
Store reusable layouts in
layouts/ subdirectoryPartials
Extract repeated sections into partial views
Components
Use Blade components for reusable UI elements
Naming
Name views to match their routes for clarity
Next Steps
Controllers
Learn how controllers pass data to views
Models
Understand data retrieval for views
Design System
Customize views and styling
