This guide provides a step-by-step process to set up and run the Laravel project. Ensure you have the required prerequisites installed before proceeding.
- PHP (>= 8.1)
- Composer (latest version)
- MySQL or any other database supported by Laravel
- Node.js (>= 16.x) and npm/yarn
- Laravel installer (optional)
git clone <repository_url>Replace <repository_url> with your project's Git repository URL.
Navigate to the project directory:
cd <project_directory>Run the following command to install PHP dependencies:
composer installCopy the .env.example file to .env:
cp .env.example .envOpen the .env file and configure the following settings:
- Database Connection: Update the
DB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE,DB_USERNAME, andDB_PASSWORDfields. - App Key: Generate a unique application key by running:
php artisan key:generate
Run the following command to migrate the database schema:
php artisan migrateIf you have seeders, run:
php artisan db:seedInstall the Node.js dependencies:
npm installBuild the frontend assets:
npm run devFor production builds:
npm run buildRun the Laravel development server:
php artisan serveThe application will be accessible at http://127.0.0.1:8000.
-
Clear Cache:
php artisan cache:clear php artisan config:clear php artisan route:clear php artisan view:clear
-
Storage Link:
php artisan storage:link
-
Run Tests:
php artisan test
- Ensure all prerequisites are installed and configured correctly.
- Verify that your
.envfile is properly set up. - Check file permissions for
storageandbootstrap/cachedirectories:chmod -R 775 storage bootstrap/cache
- Review the logs in
storage/logs/laravel.logfor detailed error messages.
This project is licensed under the MIT License.