How to Set Up and Run Laravel Boilerplate

Nov 28, 2022 | Programming

Laravel Boilerplate is a great starting point for building custom applications with Laravel. In this guide, we will walk you through the setup process, including installation, configuration, and troubleshooting tips.

Table of Contents

Features

Laravel Boilerplate offers a wide range of features that enhance the development experience:

  • Administration Dashboard with Gentelella Admin Theme
  • Responsive Layout, Bootstrap 3, and Font Awesome
  • Socialite Integration and Invisible reCAPTCHA
  • Membership plans and access control management via NetLicensing
  • MySQL, SQLite, PostgreSQL database support
  • AWS S3 support and Google Analytics configuration
  • Automatic error feedback via email
  • Internationalization support and guided tours with GuideChimp

Theme Demo

To see the Gentelella Admin Theme in action, visit the Gentelella Admin Theme Demo.

Gentelella Theme Browser Preview

System Requirements

Before you start, ensure your environment meets the following requirements:

  • PHP version: 7.4
  • PHP Extensions: BCMath, Ctype, Fileinfo, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML, cURL, Mcrypt, GD
  • Node.js: 8.x
  • Composer: 1.9.x

Installation

Follow these steps to set up Laravel Boilerplate:

  1. Install Composer:
    • Run: wget https://getcomposer.org/composer.phar
    • Then: chmod +x composer.phar && mv composer.phar /usr/local/bin/composer
  2. Install Node.js:
    • Run: yum install npm
  3. Clone the repository:
  4. git clone https://github.com/Labs64/laravel-boilerplate.git

  5. Change into the working directory:
  6. cd laravel-boilerplate

  7. Copy the example environment file:
  8. cp .env.example .env

  9. Install Composer dependencies:
  10. composer install --prefer-dist

  11. Generate an application key:
  12. php artisan key:generate

  13. Install Node.js dependencies:
  14. npm install && npm run dev

  15. Run migrations and seed data:
  16. php artisan migrate --seed

Troubleshooting

Here are some common issues and how to resolve them:

  • If you encounter PDOException, check your .env file and adjust DB_HOST=127.0.0.1 to DB_HOST=localhost or DB_HOST=mysql (for a Docker environment).
  • If you get a password error, try running: ALTER USER root@% IDENTIFIED WITH mysql_native_password BY ‘root’;

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Run

To start the PHP built-in server, run the following command:

php artisan serve --port=8080

You can then browse the site at http://localhost:8080.

Docker

To set up a Docker-based local development environment, follow these steps:

What’s Inside

This project uses docker-compose to manage services such as Laravel, MySQL, and Nginx.

Run

  1. Clone the repository: git clone https://github.com/Labs64/laravel-boilerplate.git
  2. Modify the .env file to ensure DB_HOST=mysql.
  3. Start the environment:
    • Run: docker-compose up -d for base containers.
    • Run: docker-compose -f docker-compose.yml -f docker-compose.utils.yml up -d for additional utils.
  4. Build the project:
    • Run: docker exec laravel-boilerplate_laravel-env_1 .dockerfiles/bin/prj-build.sh
    • or docker-compose run --rm laravel-boilerplate_laravel-env_1 .dockerfiles/bin/prj-build.sh
  5. Browse at http://localhost:80.
  6. To stop the environment: docker-compose down

How Tos – Modules Configuration

For more information on module configuration, visit the project wiki. You can also check the full Laravel documentation for detailed instructions.

How to Contribute

If you’d like to contribute, fork the repository, make changes, and send a pull request. Remember to check the CI validation status.

Bugs and Feedback

For any bugs or feedback, please use the GitHub Issues page.

License

This boilerplate is open-source software licensed under the MIT license.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox