Laravel Glossary

Laravel Basics

What is Laravel?

Laravel is a free, open-source PHP web framework with expressive and elegant syntax. It aims to make the development process an enjoyable experience without sacrificing app functionality.

Accessible, but powerful tool, Laravel can be used for large, robust applications.

The Laravel Card
  • Developer: Taylor Otwell
  • Release date: June 2011
  • Stable release: Version 9
  • Written in: PHP
  • Type: Web framework
  • License: MIT License
  • Website: laravel.com
  • Active Developers: +646,000 and counting
The Laravel Ecosystem
  • Laravel Vapor - a serverless deployment platform powered by AWS
  • Laravel Forge - server management for deployment and configuration
  • Laravel Envoyer - zero downtime PHP deployment system
  • Laravel Horizon - queue monitoring
  • Laravel Nova - administration panel
  • Laravel Echo - broadcasting, real-time events
  • Laravel Lumen - fast micro-framework
  • Laravel Sail - local Docker development environment
  • Laravel Jetstream - An application starter kit for Laravel/ App scaffolding
  • Laravel Valet - development environment for macOS minimalists
  • Laravel Cashier (Stripe) - subscription billing integration
  • Laravel Dusk - browser testing and automation
  • Laravel Sanctum - API/Mobile authentication
  • Laravel Scout - full-text search
  • Laravel Socialite - QAuth Authentication
  • Laravel Telescope - Debug Assistant
  • Laravel Spark - recurring billing solution
  • Laravel Mix (Compiling Assets) - Webpack assets compilation developed
Core Concepts of Laravel Framework
  • MVS (model-view-controller)

    MVS is a pattern that allows a hassle-free approach to work on big projects. Laravel has reformed front-end development with its seamless MVC architecture pattern.

  • Routing

    Routing is a service that allows the developer to load route files within the application’s routes directory. Once the application is bootstrapped, this Request is sent to a router for dispatching. Then, the router dispatches the Request to a route or Controller as well as checks us for any middleware. Routing is a process that outlines all Requests with the help of a route.

    Laravel Routing:
    - Basic routing - all application routes are inscribed in the app/routes.php file.
    - Route parameters - are defined URL paths that capture the routing of the application.
    - Named routes - the chaining of routes can be referred by name upon route definition.

  • Middleware

    Middleware provides a convenient mechanism for examining and filtering HTTP Requests entering the application. For instance, one of the middleware can verify whether the user of your application is authenticated. There is much middleware in Laravel that can be located in its directory.

  • CSRF Protection

    Cross-site request forgery (CSRF), aka one-click attack or session riding, is a type of malicious exploit where unauthorized commands are submitted on behalf of an authenticated user. Laravel protects your application from CSRF attacks by automatically generating a CSRF ‘token’ for each active user session managed by the application. The token is stored in the user’s session and it is used to verify the authenticated user who is making the request to the application. Plus, the token changes each time the session is regenerated. In this way, a malicious application is unable to access it, and your application is safe and sound.

  • Controller

    The Controller is responsible for passing information between Models and Views. Controllers have the ability to handle group-related requests in a single class.

    Types of Controllers:
    - Basic Controller
    - Single Action Controller

  • Requests

    Laravel Request class provides an object-focused way to interact with the current HTTP request being handled by the application as well as retrieve the input, cookies, and files that were submitted with the request.

  • Responses

    All Routes and controllers return a response to the user’s browser. Laravel allows several different ways to return responses. The basic response is returning a string from the route or controller, and the framework automatically converts the string into a full HTTP response.

  • Views

    Views are used to separate the presentation logic and business logic. A view file contains the information that is presented to the users. It is the UI of the application and consists of HTML that will be served by the application. Views provide a convenient way to place all HTML in separate files.

  • Blade Templates

    Simple, but powerful templating engine, Blade is part of Laravel. It does not restrict you from using plain PHP code when writing your templates. Instead, Blade templates are compiled into plain PHP code and cached until they are modified. This means that Blade gives zero overhead to your application.

  • URL Generation

    Laravel offers several helpers to assist you in generating URLs for your application. The URL helps you when building links in your templates and API responses, or when generating redirect responses to another part of your application.

  • Sessions

    Sessions are used to store information about the user across multiple requests. User information is stored in a persistent store/backend that can be accessed from subsequent requests. Laravel ships with different session backends that are obtained through an expressive, unified API.

  • Validation

    Laravel provides different approaches to validate your application’s incoming data and includes a wide range of convenient validation rules.

  • Error Handling

    Errors and exceptions are already configured in Laravel. You can find this class where all exceptions thrown by your application are logged and then rendered to the user.

  • Logging

    Laravel provides robust logging services to keep you right on track with developing your application. These logging services allow you to log messages to the system error log, files, and even to Slack to notify the team.

  • Eloquent ORM

    Eloquent is an object-relational mapper (ORM) that allows you to interact with your database, but Laravel Eloquent ORM makes that ride more enjoyable. Each database table has its own corresponding ‘Model’ that allows you to interact with the table. Not only you can retrieve records, but you can also insert, update, and delete records from the table.