Installation

This guide will walk you through the process of installing Your Application on your server.

Server Requirements

Before you begin, make sure your server meets the following requirements:

  • PHP 8.1 or higher
  • MySQL 5.7+ or PostgreSQL 10+
  • BCMath PHP Extension
  • Ctype PHP Extension
  • Fileinfo PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Step 1: Clone the Repository

First, clone the repository to your local machine or server:

git clone https://github.com/yourusername/your-app.git
cd your-app

Step 2: Install Dependencies

Install PHP dependencies using Composer:

composer install

Install frontend dependencies:

npm install
npm run build

Step 3: Configure Environment

Copy the example environment file and configure it with your database credentials:

cp .env.example .env
php artisan key:generate

Edit the .env file and set your database connection details:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

Step 4: Run Migrations

Set up your database with the required tables:

php artisan migrate

Seed the database with initial data (optional):

php artisan db:seed

Step 5: Configure Web Server

Point your web server to the public directory of your application. Here's an example configuration for Nginx:

server {
    listen 80;
    server_name yourdomain.com;
    root /path/to/your-app/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

Troubleshooting

If you encounter any issues during installation, please check the following:

  • Make sure all the required PHP extensions are installed
  • Verify that your database credentials are correct
  • Check file permissions for storage and bootstrap/cache directories

For additional help, refer to the Troubleshooting Guide.