Laravel Project Setup Guide

Follow these steps to clone and set up a Laravel project from GitHub:
  1. Clone the repository:
    git clone <GitHub Repository URL>
  2. Navigate to the cloned repository:
    cd <Cloned project name>
  3. Install dependencies:
    composer install
  4. Update dependencies if needed:
    composer update
  5. Copy the environment file:
    cp .env.example .env
  6. Edit database configuration in .env:
    DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=YourDatabaseName DB_USERNAME=YourUsername DB_PASSWORD=YourPassword
  7. Generate application key:
    php artisan key:generate
  8. Run database migrations:
    php artisan migrate
  9. Start the server:
    php artisan serve
  10. If the port is in use, specify another:
    php artisan serve --port=8080
  11. Access the application at:
    http://localhost:8000
Common Error:

If you encounter the error:

Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

Add the following code to the boot method in App\Providers\AppServiceProvider:

use Illuminate\Support\Facades\Schema; public function boot(): void { Schema::defaultStringLength(191); }

Contact Me