Skip to main content

Prerequisites

Before installing Dashboard Laravel, ensure you have the following software installed on your system:
Dashboard Laravel requires PHP 8.2 or higher. Check your PHP version with php --version.
SoftwareMinimum VersionPurpose
PHP8.2+Backend runtime
Composer2.xPHP dependency manager
PostgreSQL15+Database server
GitLatestVersion control

Verify Prerequisites

Run these commands to verify your system meets the requirements:
# Check PHP version
php --version

# Check Composer version
composer --version

# Check PostgreSQL version
psql --version

# Check Git version
git --version

Installation Steps

1

Clone the Repository

Clone the Dashboard Laravel repository to your local machine:
git clone https://github.com/sofih-ii/Dashboard_php.git
cd dashboard-laravel
Make sure you have SSH keys configured if cloning via SSH, or use HTTPS as shown above.
2

Install PHP Dependencies

Use Composer to install all required PHP packages:
composer install
This will install:
  • Laravel Framework 12.0
  • Laravel Tinker 2.10.1
  • All required dependencies from composer.json
The installation may take a few minutes depending on your internet connection.
3

Configure Environment Variables

Copy the example environment file and create your own .env configuration:
# Copy the environment template
cp .env.example .env
Edit the .env file with your database credentials:
.env
APP_NAME="Dashboard Laravel"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000

# Database Configuration
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=dashboard_db
DB_USERNAME=postgres
DB_PASSWORD=your_password_here

# Session Configuration
SESSION_DRIVER=database
SESSION_LIFETIME=120

# Logging
LOG_CHANNEL=stack
LOG_LEVEL=debug
Replace your_password_here with your actual PostgreSQL password. Never commit this file to version control.
4

Generate Application Key

Generate a unique encryption key for your application:
php artisan key:generate
This command will:
  • Create a secure 32-character random string
  • Automatically update the APP_KEY value in your .env file
  • Enable Laravel’s encryption services
The application key is used to encrypt cookies, sessions, and other sensitive data.
5

Create PostgreSQL Database

Create a new PostgreSQL database for the application:
# Connect to PostgreSQL
psql -U postgres
-- Create the database
CREATE DATABASE dashboard_db;

-- Verify the database was created
\l

-- Exit psql
\q
Make sure the database name matches the DB_DATABASE value in your .env file.
6

Run Database Migrations

Execute the database migrations to create all required tables:
# Run all migrations
php artisan migrate
This will create the following tables:
  • users - User accounts and authentication
  • password_reset_tokens - Password reset functionality
  • sessions - Session management
  • clientes - Client management
  • ventas - Sales orders
  • facturas - Invoicing
  • mensajes - Messaging system
  • cache and jobs - Laravel system tables
# Check the status of all migrations
php artisan migrate:status
7

Create Test User Account

Create a test user account to access the dashboard:
# Open Laravel Tinker (interactive REPL)
php artisan tinker
# Create a new user in the database
\App\Models\User::create([
    'name'     => 'Admin',
    'email'    => '[email protected]',
    'password' => bcrypt('123456'),
]);

# Exit Tinker
exit
You can create multiple users with different credentials for testing purposes.
Always use strong passwords in production environments. This simple password is only for development.
8

Start the Development Server

Launch the Laravel development server:
php artisan serve
You should see output similar to:
INFO  Server running on [http://127.0.0.1:8000].

Press Ctrl+C to stop the server
To run the server on a different port, use: php artisan serve --port=8080
9

Access the Dashboard

Open your web browser and navigate to:
http://127.0.0.1:8000
Login with your test credentials:
You should see the login screen. After authentication, you’ll be redirected to the main dashboard.

Verify Installation

To confirm everything is working correctly:

1. Check Routes

List all available routes:
php artisan route:list
You should see 11 routes including:
  • GET / → home
  • POST /login → login
  • GET /dashboard → dashboard
  • GET /estadisticas → estadisticas
  • And more…

2. Test Authentication

  • Navigate to the login page
  • Enter your test credentials
  • Verify successful redirect to the dashboard
  • Test logout functionality

3. Check Database Connection

Verify tables were created:
psql -U postgres -d dashboard_db -c "\dt"

Common Installation Issues

Problem: Cannot connect to PostgreSQL database.Solution:
  1. Verify PostgreSQL is running: sudo systemctl status postgresql
  2. Check credentials in .env file
  3. Ensure the database exists: psql -U postgres -l
Problem: Composer cannot install dependencies.Solution:
  1. Update Composer: composer self-update
  2. Clear Composer cache: composer clear-cache
  3. Check PHP version: php --version (must be 8.2+)
Problem: “No application encryption key has been specified” error.Solution: Run php artisan key:generate to create the APP_KEY.
Problem: Laravel cannot write to storage or cache directories.Solution:
# Set proper permissions
chmod -R 775 storage bootstrap/cache
chown -R $USER:www-data storage bootstrap/cache

Next Steps

Now that you have Dashboard Laravel installed, explore the application:

Configuration Guide

Learn how to configure environment settings and customize the application

Project Structure

Understand the codebase organization and file structure

Database Models

Explore Eloquent models and database relationships

Development Workflow

Best practices for developing with Dashboard Laravel

Additional Resources

Build docs developers (and LLMs) love