Laravel is an open-source PHP framework, which is better and easy to understand. It follows a model-view-controller design pattern. It reuses the old components of different frameworks which helps in developing a web application. It offers a broad set of functionalities that incorporates the basic features of PHP frameworks like CodeIgniter, Yii, and other programming languages like Ruby on Rails. Laravel has a set of features that will give the speed of web development.
If you have enough knowledge of Core PHP and Advanced PHP, Laravel will make your work easier. It reduces a lot of time if you are making a website from start. However, a website built in Laravel is much more secure and prevents several web attacks.
1.Why should we have to use Laravel ?
- The web application becomes more scalable
- Valuable time is saved in designing the web app.
- Its namespaces and interfaces help to organize and manage resources.
- The PHP scripting language has a variety of frameworks with robust technical capabilities such as – Laravel, Symfony, CodeIgniter, Yii 2, Phalcon, CakePHP, Zend, Slim, etc. Yet, Laravel has gained the top position on the list of top PHP MVC frameworks.
2.What are server prerequisites to Install Laravel 8 ?
- PHP Version 7.3
- 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.How do we Install Laravel 8 ?
Composer
Composer for managing dependencies in Laravel. First thing you need to check you have a composer set up on your pc or not.
If you don’t have Composer installed on your PC download from the link below :
https://getcomposer.org/download/
When you are installing the Composer, check whether it is installed or not by the composer command in the command. You can see the Composer screen in that command prompt only.
For OS like MAC and Linux, it will be :-
macOS: $HOME/.composer/vendor/bin
Linux OS: $HOME/.config/composer/vendor/bin
Setup Laravel using Installer
Firstly, you need to download the Installer of Laravel with the help of Composer, like this :-
Composer global require “laravel/installer”
When the installation is complete, a new command of laravel will start installation in that directory you provide. For example, the directory name is a blog
laravel new blog
You have to make a new folder in a specific path in your system for storing your Laravel projects. You just need to go to that location where the directory is created. Installing laravel, the following commands.
composer create-project – prefer – dist laravel/laravel:^8.0 blog
The command mentioned above will make Laravel installed on that specific directory. Type the next command :
php artisan serve
The above code will start the Laravel service. A black screen will appear showing the message :
Laravel Development server started on http://localhost:8080.
Copy and paste: http://localhost:8080 in your browser, and you can see the Laravel home screen appears in your browser.
Laravel File Structure
- root
- app
- Console
- Events
- Exceptions
- Http
- Jobs
- Listeners
- Notifications
- Policies
- Providers
- Rules
- bootstrap
- config
- database
- public
- resources
- routes
- storage
- test
- vendor