What is Laravel?

Agasthi Sankalana
4 min readMay 22, 2021

--

Laravel is a free and open-source PHP framework that provides a set of tools and resources to build modern PHP.which is dependable and simple to comprehend. The architecture pattern is model-view-controller. Laravel reuses existing components from various frameworks to aid in the development of web applications. The resulting web application is more organized and practical.

Laravel has a large feature set that includes the core features of PHP frameworks such as CodeIgniter and Yii, as well as other programming languages such as Ruby on Rails. Laravel has a large number of features that will speed up web growth.

Laravel comes with a powerful database tool called Eloquent, which includes an ORM (Object Relational Mapper) and built-in frameworks for creating database migrations and seeders.
Developers can bootstrap new models, controllers, and other application components using the command-line tool Artisan, which speeds up overall application creation.

Advantages of Laravel

  • The web application becomes more scalable, owing to the Laravel framework.
  • Considerable time is saved in designing the web application, since Laravel reuses the components from other framework in developing web application.
  • It includes namespaces and interfaces, thus helps to organize and manage resources.

Composer

Composer is a program that installs all of the required dependencies and libraries. It enables a user to build a project that adheres to the framework described (for example, those used in Laravel installation). Composer makes it easy to add third-party libraries.

All the dependencies are noted in composer.json file which is placed in the source folder.

Artistan

Artisan is the name of the command line interface used by Laravel. It comes with a collection of commands that help you create a web application. These commands are derived from the Symphony system, resulting in Laravel add-on functionality.

Features of Laravel

  • Modularity

Laravel comes with 20 built-in libraries and modules to help you improve your application. Every module has a Composer dependency manager built in, which makes updating a breeze.

  • Testability

Laravel has a number of features and helpers that aid in the testing of different test cases. This function aids in keeping the code up to date and in compliance with the specifications.

  • Routing

Laravel gives the user a versatile way to identify routes in a web application. Routing makes it easier to scale the application and improves its consistency.

  • Query builder and ORM

Laravel includes a query builder that allows you to query databases using simple chain methods. Eloquent is an ORM (Object Relational Mapper) and ActiveRecord implementation.

  • Schema builder

The database definitions and schema are held in PHP code by Schema Builder. It also keeps track of changes made to databases during migrations.

  • Configuration Management

A web application written in Laravel can run in a variety of environments, implying that its configuration can change frequently. Laravel offers a consistent solution to efficiently manage configuration.

How does Laravel work

Laravel uses a design pattern called Model-View-Controller, or MVC.

The “Model” is the form of the data that your application works with. This is your model: a table of users, each with a list of posts they’ve made.

This model is interacted with by the “Controller.” When a user asks to see their posts list, the controller communicates with the model (which is usually just the database) and retrieves the information. The controller updates the model if the user wants to make a new message. The controller houses the majority of your application’s logic.

This information is used by the controller to create a “View.” The view is a prototype into which the model can be plugged and viewed, and which the controller can manipulate. All of your application’s HTML components are included in the view.

This framework is used by Laravel to power custom apps. The Blade templating engine is used, which allows HTML to be broken down into smaller chunks and handled by the controller. It all begins with routes, which are specified in routes/web.php and handle HTTP requests based on the requested location.

For example, http://mtweb.com/user:

Route::get('user', function (){
return view('user', ['name'=>'Agasthi']);
});

This route executes a function that returns a view from resources/views/. The view has been passed data.

<!-- View stored in resources/views/user.blade.php --><html>
<body>
<h1>Hello, {{ $name }}</h1>
</body>
</html>

Laravel has middleware that runs until the request is processed. You might use this to secure some pages by ensuring that a user is authenticated before processing a request.

Instead of directly displaying a view, you can send the request to a controller, which can handle more complex logic before returning a resource.

Thank You !..

--

--

Agasthi Sankalana
Agasthi Sankalana

Written by Agasthi Sankalana

Blogger | Gamer 🎮 | Backend Dev | Devops | SLIIT 🎓

No responses yet