How to set up a Laravel environment?
Laravel is an open-source web application framework built on PHP that offers tools for creating robust, powerful applications. It was developed and maintained by Taylor Otwell as an attempt to provide a more advanced alternative to the CodeIgniter framework. Its architectural patterns are majorly based on Symfony. It provides a structure that makes it easier to build and prepare for huge projects. One of the most secure platforms with a PHP foundation is this one. It offers built-in user authorization capabilities like login, registration, and forgotten password assistance. Currently, Laravel framework is quite popular for website design and development in Nepal.
You will discover in this post how to set up a full Laravel development environment on your local server, which you can later upload to a live production environment.
- Install composer on Windows:
Follow the following link for composer installation steps click here.
2. Check the server requirement for the setup:
- PHP >= 7.4
- 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.
3. Installing Laravel:
Type the following command in your command prompt window:
- composer global require “laravel/installer”.
- composer create-project –prefer-dist laravel/laravel Project_name: this command will install Laravel and other dependencies with it and also generate the ANSI key.
4. Create Database for Project:
- Go to phpMyAdmin click on create a new tab.
- Name the database.
- Press the create button.
5. Update .Env file:
6. Migrate database:
Create tables in the database for Laravel access, also helps in database version control following are the commands for migration.
- PHP artisan make migration create_databse_table: this command is used to create the DB migration file in your ‘database/migration’ folder.
- PHP artisan migrate: used to run the pending migration changes to the database.
7. Start development server:
PHP artisan serve: this command starts your development server.
8) Go to the IP URL that you see on your CMD screen.
Additional Links and Resources:
- Laravel : Official Website
- PHP : Official Website
- MySql : Official Website
- Composer : Official Website
Written Course for Laravel:
You can reach out to us if you want to learn more about how we can be beneficial to you and help you develop your web design, website design and web development projects in Nepal.