Skip to main content

Prerequisites

Before installing the Restaurant Management System, ensure your development environment meets these requirements:

Required Software

  • PHP 8.1 or higher
  • Composer 2.x
  • Node.js 16.x or higher
  • npm 8.x or higher
  • MySQL 5.7+ or MariaDB 10.3+
  • Git (for cloning the repository)
PHP 8.1 is the minimum required version. Using PHP 8.2 or 8.3 is recommended for better performance and security.

Verify PHP Extensions

Ensure the following PHP extensions are enabled:
php -m | grep -E "PDO|mbstring|tokenizer|xml|ctype|json|bcmath|fileinfo"
Required extensions:
  • PDO
  • mbstring
  • OpenSSL
  • Tokenizer
  • XML
  • Ctype
  • JSON
  • BCMath
  • Fileinfo

Installation Steps

1

Clone the Repository

Clone the project to your local machine:
git clone <repository-url> restaurant-management
cd restaurant-management
2

Install PHP Dependencies

Install all Composer dependencies defined in composer.json:
composer install
This will install:
  • Laravel Framework (^10.10)
  • Laravel Jetstream (^4.3)
  • Livewire (^3.0)
  • Spatie Laravel Permission (^6.21)
  • Laravel Sanctum (^3.3)
  • And other dependencies
If you encounter memory issues, try: php -d memory_limit=-1 /usr/local/bin/composer install
3

Install Node Dependencies

Install frontend dependencies and build assets:
npm install
This installs:
  • Tailwind CSS (^3.1.0)
  • Vite (^5.0.0)
  • Alpine.js (via Livewire)
  • SweetAlert2 (^11.14.5)
  • Axios (^1.6.4)
4

Environment Configuration

Copy the example environment file and generate an application key:
cp .env.example .env
php artisan key:generate
The key:generate command sets the APP_KEY value in your .env file, which is used for encryption.
5

Configure Database

Edit your .env file with your database credentials:
.env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=restaurante
DB_USERNAME=root
DB_PASSWORD=your_password
Create the database:
mysql -u root -p
CREATE DATABASE restaurante CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;
6

Run Migrations

Create all database tables by running migrations:
php artisan migrate
This creates tables for:
  • Users and authentication (users, password_reset_tokens, sessions)
  • Roles and permissions (roles, permissions, model_has_roles, etc.)
  • Food management (food, categories)
  • Orders (orders, order_items, carts)
  • Restaurant operations (tables, reservations, chefs)
Make sure your database exists and credentials are correct before running migrations. Migration failures usually indicate connection issues.
7

Seed the Database

Populate the database with initial data including roles and demo users:
php artisan db:seed
This creates:
8

Storage Link

Create a symbolic link for file storage (for food images):
php artisan storage:link
This links public/storage to storage/app/public for public file access.
9

Build Frontend Assets

Compile frontend assets for development:
npm run dev
Or for production:
npm run build
Keep npm run dev running during development for hot module replacement (HMR). Vite will watch for file changes and automatically rebuild.
10

Start the Development Server

Launch the Laravel development server:
php artisan serve
The application will be available at http://localhost:8000

Verification

After installation, verify everything is working:

Check Application Status

php artisan about
This displays your Laravel installation details, environment, and configuration.

Test Database Connection

php artisan db:show
This confirms your database connection and displays table information.

Verify Permissions

Check that roles and permissions were created:
php artisan tinker
Spatie\Permission\Models\Role::all()->pluck('name');
// Should return: ["admin", "user", "chef", "mesero"]

User::with('roles')->get();
// Should show 4 users with their assigned roles

Configuration Options

Application Settings

.env
APP_NAME="Restaurant Management"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000

Session Configuration

.env
SESSION_DRIVER=database
SESSION_LIFETIME=120
The system uses database sessions by default. Make sure the sessions table exists after running migrations.

Mail Configuration (Optional)

For email notifications and password resets:
.env
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
For local development, use Mailpit or Mailtrap to test emails without sending real messages.

Alternative Installation Methods

Using Laravel Sail (Docker)

For a containerized development environment:
# Install dependencies via Composer in a temporary container
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install --ignore-platform-reqs

# Start Sail
./vendor/bin/sail up -d

# Run migrations and seeders
./vendor/bin/sail artisan migrate --seed

# Install npm dependencies
./vendor/bin/sail npm install
./vendor/bin/sail npm run dev

Using Laravel Valet (macOS)

For macOS users with Valet installed:
cd restaurant-management
composer install
cp .env.example .env
php artisan key:generate
valet link restaurant-management
Access your site at http://restaurant-management.test

Troubleshooting

Common Issues

Issue: Memory limit or dependency conflictsSolutions:
# Increase memory limit
php -d memory_limit=-1 /usr/local/bin/composer install

# Clear Composer cache
composer clear-cache

# Update dependencies
composer update
Issue: Database connection or table already existsSolutions:
# Test database connection
php artisan db:show

# Fresh migration (WARNING: destroys data)
php artisan migrate:fresh --seed

# Reset specific migration
php artisan migrate:rollback --step=1
php artisan migrate
Issue: Storage or cache directory permissionsSolution:
# Fix permissions (Linux/macOS)
chmod -R 775 storage bootstrap/cache
chown -R $USER:www-data storage bootstrap/cache

# Clear cache
php artisan cache:clear
php artisan config:clear
php artisan view:clear
Issue: Vite not running or build failedSolutions:
# Ensure Vite is running
npm run dev

# Or build for production
npm run build

# Clear npm cache
rm -rf node_modules package-lock.json
npm install

Next Steps

Now that your installation is complete:

Quick Start Guide

Follow our quickstart guide to create your first menu items and process orders

Authentication

Learn about the role-based authentication system
Save the seeded user credentials in a secure location. You’ll need them to log in for the first time.

Build docs developers (and LLMs) love