Introduction
Laravel is a powerful and elegant PHP framework designed to make web development easier and more enjoyable. It provides a robust set of tools and an expressive syntax that simplifies common tasks such as routing, authentication, and caching. Coupled with various pre-built facades for simple tasks and easy integration with frameworks like Vue/React
, and the usage of expressive Blade
templates makes it an easy introduction to backend web development.
The ecosystem is rich and supports all kind of tools, including API based authentication (Sanctum), Breeze for authentication scaffolding, tools like Valet(for Mac) and Herd for installation & setup and so many others.
It has become one of the most popular frameworks in the web development community due to its comprehensive features and ease of use. It promotes clean, maintainable code and offers a wide range of built-in functionalities that speed up the development process. Its robust ecosystem makes it an ideal choice for building modern web applications👌👌👌.
Just look at number of different integrations available (these are just the popular ones)🤯
Goals of the Article
Getting Started with Laravel
Prerequisites
Before getting started with the tutorial, you should have some basic knowledge:
- Basic understanding of PHP
Laravel is a PHP framework. But the knowledge of PHP required is not that deep. If you have worked with languages like C/C++/C#/JavaScript
, you should have no problem directly getting started with Laravel.
You need to understand the syntax, how to use arrays, functions, and the basics of classes. The fastest way to understand it is by watching this Fireship video(PHP in 100 seconds) 😊😁:
Documentation Resources for learning PHP basics:
- Basic Understanding Of MVC
The Model-View-Controller (MVC) architecture is a design pattern used in software engineering to separate the concerns of an application into three interconnected components:
Model:
The Model represents the data and the business logic of the application. It directly manages the data, logic, and rules of the application.
It is responsible for retrieving data from the database, processing it, and returning it to the controller or view.
The Model is independent of the user interface, meaning changes to the UI do not affect the data handling logic.
View:
The View is the user interface of the application. It displays the data provided by the Model to the user and sends user commands to the Controller.
It is responsible for presenting the data in a specific format, which can be HTML, JSON, XML, etc.
The View does not contain any business logic; it only handles the presentation layer.
Controller
The Controller acts as an intermediary between the Model and the View. It listens to the input from the View, processes it (often by calling the Model), and returns the output display to the View.
It handles the user input, manipulates the Model, and updates the View accordingly.
The Controller contains the application logic that determines how the data should be displayed and how the user interactions should be handled.
How MVC Works Together
- User Interaction: The user interacts with the View (e.g., by clicking a button or submitting a form).
Controller Handling: The Controller receives the input from the View, processes it (e.g., by validating the input or performing some business logic), and interacts with the Model.
Model Update: The Model updates its state based on the Controller's instructions (e.g., by saving data to the database or retrieving data).
View Update: The View updates its display based on the changes in the Model, providing the user with the updated data.
Benefits of MVC
Separation of Concerns: Each component has a distinct responsibility, making the application easier to manage and scale.
Reusability: Components can be reused across different parts of the application or even in different projects.
Maintainability: The separation of concerns makes it easier to update and maintain the application, as changes in one component have minimal impact on others.
Testability: The clear separation of components makes it easier to write unit tests for each part of the application.
MVC is widely used in web development frameworks, including Laravel, to create structured and maintainable codebases.
- Basic understanding of Web Development
You need to be familiar with concepts like HTTP/HTTPS, RESTful APIs, have an understanding of how web servers work under the hood, know the Client-Server architecture basics, and understand how the Internet works.
Concepts required:
Internet basics
Web servers basics
Frontend Basics (HTML/CSS)
- Database Fundamentals and SQL
Basic understanding of databases and SQL is essential. Even though Laravel uses the Eloquent ORM for database setup, knowing the basics of relational databases and SQL will make you a better developer, especially during the Model/Schema design phase. Understanding databases is crucial to design relationships for different models, being able to filter queries, perform joins on related tables and so on. You can also use raw SQL queries if required for particularly nuanced querying.
References:
Environment Setup
To develop a Laravel application a few components are required. These include:
PHP
Composer, the dependency(package) manager for PHP packages.
A database server of your choice (can be MySQL, PostgreSQL, or others)
Need to install Laravel using Composer.
There are a number of ways you can install the required components. The manual way would be to:
Install PHP from here.jdjjj
Install Composer from here.
Install either MySQL or Postgres ( can use
sqlite
also if beginner)
For an easy setup, you can install XAMPP on your system. It includes PHP, MySQL, Apache and Perl and is the preferred way to get started with PHP projects.
There are other tools which simplify the setup for Laravel/PHP, including:
Herd (seems like a great option, but only for Windows/Mac)
Valet (a great option, but only for Mac)
Whichever method you end up using, you should have the following commands working:
Before installing herd:
After installing herd:
Installing Laravel
- Using Herd
You can directly create Laravel projects in Herd. You can also park existing projects into the configured directory.
Herd is beneficial because it is hassle-free, and allows you to manage multiple projects easily. Also includes nginx out of the hood, and saves you the hassle of installing multiple components like composer, PHP, nginx etc... It also generates test domains on the fly without having to modify apache.conf
or other configuration files.
Herd seems like a cool tool with powerful features like HTTP/HTTPS, selecting between different versions of PHP, automatic tinker setup etc...
- Via Composer Create-Project
composer create-project laravel/laravel example-app
- Using Laravel Installer
# here, we install the installer the first time, and then later on use only the second command
composer global require laravel/installer
laravel new example-app
Whichever method you end up using, your directory structure inside the project should look like this:
Understanding the Laravel Directory Structure
Overview of Key Directories and Files
The project contains some key directories at install time. Most of them are related to core installed components, and most of our work is limited to the MVC component directories: app/Models
contains the model files, database/
contains the various database items like factories, migration files, seeders and so on, resources
contains the frontend views and assets like CSS/JS files, and routes
contains route files for web (web.php
) and API (api.php
). In addition, app/Http/Controllers
contains the controllers. These are the main directories our activities will be restricted to.
App Directory
The app
directory contains the core code of your application. It includes subdirectories for controllers, models, and middleware. This is where most of your application logic resides.
Config Directory
The config
directory holds all of your application's configuration files. Each file corresponds to a specific aspect of the framework or your application, such as database settings, mail configuration, and more.
Routes Directory
The routes
directory contains all route definitions for your application. By default, it includes files like web.php for web routes and api.php for API routes.
Resources Directory
The resources
directory is where you store your views, raw assets (like CSS and JavaScript), and language files. The views
subdirectory is particularly important for Blade templates.
Tests Directory
The tests
directory is where you write your automated tests. It includes subdirectories for unit tests and feature tests, helping you ensure your application works as expected.
Routing in Laravel
Routing basically means mapping the URLs to specific controllers for handling various types of requests. They are defined in the routes
directory: primary files are web.php
and api.php
.
Basic Routing Examples
For instance, if your are trying to access /welcome
with a GET request, Laravel route will contain this:
Route::get('/welcome', function () {
return view("welcome");
});
You can modify these routes as required. Although note that it is standard practice to use Controllers for declaring the view functions, like this:
Route::get(
'/wall',
[PostController::class, 'showPosts']
);
Routes with parameters
You can use various types of slugs/parameters for dynamic routing.
Route::get(
'/post/{pid}',
[PostController::class, 'singlePost']
)->where('pid', '[0-9]+');
Here pid
is the slug, and we define what kind of slugs are allowed and such in an optional where clause for the route. This slug or parameter will get passed to the function; in the above case, the singlePost()
function in the PostController
.
Route Model Binding
Route Model Binding in Laravel is a feature that allows you to automatically inject model instances into your routes based on the route parameters. This simplifies the process of retrieving models from the database and ensures that your code is cleaner and more efficient.
For example, if you have a Dept
model, you can do:
Route::get('/report/{dept}', [ReportController::class, 'index'])->name('report.index');
Which can later on in report controller be accessed as below
public function index(Dept $dept, Request $request){
// it automatically checks if Dept has an object with primary ID $dept
// thus preventing need to query Dept model and check for item
}
Named Routes
Named routes allow you to name certain URLs.
Route::get('/profile', function () {
// ...
})->name('profile');
// somewhere else
$url = route('profile');
// suppose you want to generate profile link in the frontend.
Named routes can also have hierarchy, viz, we can have charts.index
and reports.index
routes, making it simple to keep track of routes. It is a good idea to name your routes because it becomes easy to perform redirects easily.
Route Groups and Middleware
You can group specific set of routes together for a particular type of application, for instance, if you want to allow only admin
to access some dashboards, then you can create a Route group and apply the required middleware to it (don't worry about middleware just yet). For instance, in my alumni-website project:
// @routes which allow only authenticated users...
Route::group(['middleware' => 'auth.loggedIn'], function () {
Route::get('wall', [PostController::class, 'showPosts']);
Route::get('/post/{pid}', [PostController::class, 'singlePost']);
Route::get("/jobs", [ListingController::class, 'index']);
Route::get("/jobs/{jid}", [ListingController::class, 'singleListing']);
Route::get("/job/search/tags/", [ListingController::class, 'searchedTag']);
// ...
});
Route Resource Controllers
Laravel provides a convenient way to define routes for resourceful controllers, which handle CRUD operations:
Route::resource('photos', PhotoController::class);
This single line of code generates multiple routes for handling various actions like index, create, store, show, edit, update, and destroy.
Route Caching
For performance optimization, Laravel allows you to cache your routes:
php artisan route:cache
This command will compile all of your routes into a single file, which can significantly speed up route registration.
Controllers in Laravel
What is a Controller?
A controller in Laravel is a class that manages the request logic for your application. It handles the processing part of the MVC stack for Laravel; it processes user input, handles model interactions, and returns appropriate responses to the View layer. Controllers help to organize the application logic and make it more manageable. By making multiple controllers, one can keep different operations logically distinct and promote team-work.
Creating a Controller
To create a controller in Laravel, we can use the Artisan command-line tool. The command to create a new controller is:
php artisan make:controller ControllerName
Here, replace ControllerName
with the desired name of the controller. It is standard practice to name controllers as somethingController
; for instance, ProfileController, AdminController and so on.
Basic Controller Methods
Once created a controller file is created with a basic class, similar to this ProfileController:
<?php
namespace App\Http\Controllers;
use App\Http\Requests\ProfileUpdateRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\View\View;
class ProfileController extends Controller
{
// add stuff here
public function show(){
return view("profile.show");
}
/**
* Display the user's profile form.
*/
public function edit(Request $request): View
{
return view('profile.edit', [
'user' => $request->user(),
]);
}
}
Within the class, you can define a variety of functions. Each function may be either a function that is added to the routes in web.php
or some auxiliary function that is used by the other view functions.
Most controller functions work in two ways. They either directly render a view by returning a view, or they redirect to some other named route. This logic is handled by the programmer, as required. Within the controller, you can do extra validation and checking; for instance, checking for authentication, roles and so on.
The view()
function takes two parameters:
View name. This refers to the name of the view file that needs to be rendered. It is usually specified as a string. It corresponds to the path of the view files within the
resources/views
directory, omitting theblade.php
extension. Also, if there are subfolders within theviews
directory, they are referenced using dot notation (for example, to render the viewresources/views/main/home/index.blade.php
, you have to returnview(‘main.home.index’)
.The second parameter to the view function is an optional data array. This array is the method used to pass data to the view. This should always be an array. A common method used to pass different values is to use the
compact
function, as shown below:public function index(Request $request) { $name = "Some name"; // usually by querying some db $date = now(); return view('home.index', compact('name','date')); }
The compact function allows the programmer to directly specify the names of the data objects that will be passed on to the view.
Route Resource Controllers
Laravel provides a convenient way to define routes for resourceful controllers, which handle CRUD operations. You can use the resource
method in your routes file to automatically generate routes for these actions:
Route::resource('resource-name', 'ControllerName');
This single line of code generates multiple routes for handling various actions like index
, create
, store
, show
, edit
, update
, and destroy
. Note that it checks the controller to find those particular controller functions and throws an error if they are not defined in the controller.
Views and Blade Templating Engine
Introduction to Views
In Laravel, views are used to separate the presentation logic from the business logic. They are responsible for displaying the data to the user and are typically written in HTML, with embedded PHP for dynamic content. By allowing the use of components, sub-views and layouts, blade simplifies the frontend design portion and saves a lot of developer time.
Creating and Returning Views
Views are stored in the resources/views
directory. You can create a view by creating a new file with the .blade.php
extension. To return a view from a controller, use the view()
function, specifying the view name and any data you want to pass to it. As explained above, hierarchical directories of views utilize the dot notation in view() function.
Blade Templating Engine Basics
Blade is Laravel's powerful templating engine that provides a simple yet effective way to work with views. It allows you to use plain PHP code in your templates and offers features like template inheritance and sections. Blade also provides various directives such as @if
, @unless
, and others for performing logical checks within the view, as well as the @php
directive if you need to execute raw PHP code within the view (although this processing is typically handled in the controller). The simple logic for most blade directives is :
@if
// stuff tbd
@endif
Similar syntax is followed for unless
, forelse
and various other allowed directives.
Blade files use the .blade.php
extension.
Template Inheritance
Blade allows you to define a master layout and extend it in other views. This is done using the @extends
directive in child views and @yield
in the master layout to define sections that can be filled by child views.
Including Sub-Views
If there are some parts of the frontend that remain unchanged on all pages, it is a smart idea to keep them in one place and render them using that, because in the event of some modification, modifying in one place cascades that change everywhere else. Doing this is simple within Laravel. Merely use the @include
directive along with the name of the file to be included (using dot notation if it resides within subfolder). For example:
@include('partials.navbar')
Layouts
Layouts allows Laravel to make scaffolding for basic structure of the view, which can then be. An example master layout may contain all the necessary connections to CSS, JS files, style setup, basic template and so on. Within this the sections created by the yield directive can then be populated by child view.
For instance, check out this basic layout, named guest-layout
in views/layouts
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@yield('title')</title>
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
@yield('extraHead')
</head>
<body>
<header>
@include('partials.navbar')
</header>
<main>
@yield('content')
</main>
<footer>
@include('partials.footer')
</footer>
<script src="{{ asset('js/app.js') }}"></script>
@yield('extraScript')
</body>
</html>
In this layout, @include('partials.navbar')
and @include('partials.footer')
are used to include the navbar and footer sub-views, respectively. These sub-views should be located in the resources/views/partials
directory. The @yield
directives remain placeholders for additional content that can be filled by child views.
Now say for instance I want to render a page for home
route. I can use the layout guest-layout
and populate the required sections.
@extends('layouts.guest-layout')
@section('title')
Home page
@endsection
@section('content')
<h1> Learning Basics of Laravel! </h1>
<div> Keep practicing, you get better! </div>
@endsection('content')
@section('extraScript')
<script>
console.log('hello!');
</script>
@endsection
Rendering Data within View
To render some values within the view, we use the {{ $stuff }}
notation. Basically, Laravel replaces everything within {{
and }}
with its PHP value. Within the double braces it is possible to render direct values, or use the ternary operator to generate some other value:
Rendering Direct Values:
You can directly display a variable's value using double braces. For example, if you have a variable
$name
, you can render it like this:<h2> My name is {{ $name }}</h2>
This will output the value of the
$name
variable that is passed by controller function to calling view.Using the Ternary Operator:
You can use the ternary operator within double braces to conditionally render a value. For example, if you want to display "Guest" if the
$name
variable is not set, you can do it like this:<h2>Welcome, {{ $name ?? 'Guest' }} ! </h2>
Working with Databases
Database Configuration
In Laravel, database configuration is managed through the config/database.php
file. You can set up connections for various database systems like MySQL, PostgreSQL, SQLite, and SQL Server. The default connection settings can be specified in the .env
file, where you define parameters such as DB_CONNECTION
, DB_HOST
, DB_PORT
, DB_DATABASE
, DB_USERNAME
, and DB_PASSWORD
.
Running Migrations
Migrations are a way to manage your database schema over time. They allow you to define database tables and columns using PHP code. You can create a new migration using the Artisan command:
php artisan make:migration create_table_name
To apply migrations and update the database schema, use:
php artisan migrate
Migrations are powerful because they tie in nicely with any database, allow for progressive changes to database schema while nicely keeping track of said changes for debugging purposes. It is also possible to perform refresh
(recreating database from first migration while losing existing data), and also seed the database using seeders at same time using —seed
flag.
They can be rolled back over time one at a time, allowing developers to undo specific changes to the database schema. This feature is particularly useful for testing and development, as it enables you to revert to a previous state if a migration introduces an error or if you need to test different schema configurations.
By using the php artisan migrate:rollback
command, you can step back through your migration history, undoing the most recent batch of migrations.
Defining Models
Models in Laravel are defined as classes that extend the Illuminate\Database\Eloquent\Model
class. Each model corresponds to a table in the database. You can create a new model using the Artisan command:
php artisan make:model ModelName
This generates a Model file within above shown path. We can add different useful types of information within the model file; for example, it is possible to add hidden attributes to hidden
array, prevent or allow mass assignment using the fillable
, form parent-child or other types of relationships with other models using functions, specify different table name or database connection and lots of other things.
Note that to tie in nicely with controllers, migrations, factories, seeders and so on, Artisan
allows one to create all these for a particular Model during model creation itself. This can be done by using flags. For instance, creating migration, factory and controller for Alumni while creating the Alumni
model is possible using:
php artisan make:model Alumni -mcf
Eloquent ORM
Eloquent is Laravel's Object-Relational Mapping (ORM) system, which provides an elegant syntax for interacting with the database. It allows you to define models that represent database tables and provides methods for querying and manipulating data.
Eloquent lets developers work with object-relational models instead of raw SQL queries, making it easy to connect different data sources within the database.
Basic CRUD Operations
It is simple to implement CRUD operations using Eloquent methods in Laravel.
Create
You can create a new record using the create
method or by instantiating a new model and calling save
.
Using the create
method:
$user = User::create([
'name' => 'John Doe',
'email' => 'john@example.com',
'password' => bcrypt('password'),
]);
Using save
:
$user = new User;
$user->name = 'John Doe';
$user->email = 'john@example.com';
$user->password = bcrypt('password');
$user->save();
Read
You can retrieve data using methods like all
, find
, where
, and first
.
Retrieve all records:
$users = User::all();
Find a record by primary key:
$user = User::find(1);
Retrieve records with a condition:
$activeUsers = User::where('status', 'active')->get();
Retrieve the first record that matches a condition:
$user = User::where('email', 'john@example.com')->first();
Update
To update a record, retrieve the model instance, modify its attributes, and call save
.
$user = User::find(1);
$user->name = 'Jane Doe';
$user->save();
Delete
To delete a record, use the delete
method on a model instance.
$user = User::find(1);
$user->delete();
Query Builder
Laravel's Query Builder provides a more direct way to interact with the database using a fluent interface. It allows you to construct SQL queries programmatically. You can use it to perform complex queries, joins, and aggregations without writing raw SQL. The Query Builder is accessible via the DB
facade:
$users = DB::table('users')->where('status', 'active')->get();
This example retrieves all active users from the users
table.
Direct SQL
In Laravel, you can execute raw SQL queries using the DB
facade. This is useful when you need to perform complex queries that are not easily handled by Eloquent or the Query Builder. Here are some examples of how to use raw SQL within Laravel:
- Select Queries
To execute a raw select query, you can use the select
method:
$users = DB::select('SELECT * FROM users WHERE active = ?', [1]);
This will return an array of results, where each result is an instance of the stdClass
object.
- Insert Queries
To execute a raw insert query, you can use the insert
method:
DB::insert('INSERT INTO users (name, email) VALUES (?, ?)', ['John Doe', 'john@example.com']);
- Update Queries
To execute a raw update query, you can use the update
method:
DB::update('UPDATE users SET votes = 100 WHERE name = ?', ['John Doe']);
- Delete Queries
To execute a raw delete query, you can use the delete
method:
DB::delete('DELETE FROM users WHERE active = ?', [0]);
- General Statements
For executing general SQL statements, such as creating or dropping tables, you can use the statement
method:
DB::statement('DROP TABLE users');
These methods allow you to execute raw SQL queries directly, providing flexibility for complex database operations.
By keeping data accession choice based Laravel allows developers the flexibility to work with either of Eloquent models, Query builder or even raw SQL as per their own choices.
Artisan Command-Line Interface
Artisan is Laravel's built-in command-line interface (CLI) that provides a variety of helpful commands for developing Laravel applications. It simplifies common tasks such as database migrations, running tests, and generating boilerplate code.
Commonly Used Artisan Commands
List All Commands:
To see a list of all available Artisan commands, use:
php artisan list
Make Commands:
Artisan provides several
make
commands to generate various components of a Laravel application:Controller:
php artisan make:controller ControllerName
Model:
php artisan make:model ModelName
Migration:
php artisan make:migration create_table_name
Seeder:
php artisan make:seeder SeederName
Serve Command:
To start a local development server, use:
php artisan serve
This command will start a server at
http://localhost:8000
.Clearing Configurations:
Artisan provides commands to clear various caches:
Config Cache:
php artisan config:clear
Route Cache:
php artisan route:clear
View Cache:
php artisan view:clear
Running Migrations:
To run database migrations, use:
php artisan migrate
Database Seeding:
To seed the database with test data, use:
php artisan db:seed
Custom Artisan Commands
You can create custom Artisan commands to automate tasks specific to your application. To generate a new command, use:
php artisan make:command CommandName
This will create a new command class in the app/Console/Commands
directory. You can define the command's functionality by implementing the handle
method within this class. Once created, you can run your custom command using:
php artisan command:name
Replace command:name
with the name you define in the command class.
Middleware in Laravel
What is Middleware?
Middleware in Laravel is a type of filtering mechanism that sits between the request and response cycle. It provides a convenient way to inspect and modify HTTP requests entering your application. Middleware can perform a variety of tasks, such as authentication, logging, and modifying request data. For example, you can design a middleware to count unique IP visitors.
Using Built-in Middleware
Laravel comes with several built-in middleware that handle common tasks. Some examples include:
auth
: Ensures that the user is authenticated.guest
: Redirects authenticated users to a different page.throttle
: Limits the number of requests a user can make in a given time period.verified
: Ensures that the user has verified their email address.
These middleware can be applied to routes or groups of routes to enforce specific behaviors.
Creating Custom Middleware
To create custom middleware, you can use the Artisan command:
php artisan make:middleware MiddlewareName
This command generates a new middleware class in the app/Http/Middleware
directory. You can define the logic for your middleware in the handle
method. For example, you might create middleware to log requests or check for specific headers. For example, I have created a TrackVisitors
middleware:
<?php
namespace App\Http\Middleware;
use Closure;
use App\Models\Visitor;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class TrackVisitors
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
$ip = $request->ip();
$userAgent = $request->userAgent();
// using a Visitor model that I have created to keep track of visitors...
$visitor = Visitor::firstOrCreate(
['ip_address' => $ip],
[
'visit_count' => 0,
'visited_at' => now(),
'user_agent' => $userAgent ?: 'Unknown',
]
);
// Increment the visit count if the visitor already exists
$visitor->increment('visit_count');
return $next($request);
}
}
Applying Middleware to Routes and Controllers
Middleware can be applied globally, to specific routes, or to route groups.
Global Middleware: Registered in the
$middleware
array inbootstrap/app.php
, affecting all requests.return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__.'/../routes/web.php', commands: __DIR__.'/../routes/console.php', health: '/up', api: __DIR__ . '/../routes/api.php' ) ->withMiddleware(function (Middleware $middleware) { // ! adding the visitor count middleware here! $middleware->append(TrackVisitors::class); }) ->withExceptions(function (Exceptions $exceptions) { // })->create();
Route Middleware: These can be applied to specific routes or groups:
Route::middleware(['auth'])->group(function () { Route::get('/', function () { return view('welcome'); }); });
Controller Middleware: Applied within a controller's constructor using the
middleware
method:public function __construct() { $this->middleware('middlewareName'); }
Middleware provides a flexible way to manage request handling and can be customized to fit the specific needs of your application.
Conclusion
As you continue your journey with Laravel, there are several advanced topics and features you can explore to enhance your skills and build more robust applications:
Job Scheduling: Learn how to schedule tasks using Laravel's task scheduling feature, which allows you to automate repetitive tasks and manage
cron
jobs efficiently.HTTP Requests: Dive deeper into handling HTTP requests, including form validation, file uploads, and managing sessions.
Policies: Understand how to implement authorization logic using policies, which provide a clean and organized way to manage user permissions and access control.
Service Providers: Explore the role of service providers in bootstrapping your application and how they can be used to bind services into the service container.
Event Broadcasting: Learn about real-time event broadcasting with Laravel Echo and Pusher, enabling you to build interactive, real-time web applications.
Testing: Enhance your testing skills by writing unit tests, feature tests, and using Laravel's testing utilities to ensure your application works as expected.
There is a wide array of community developed packages, including packages for handling Permissions, Excel files import export, Admin templates with AdminLTE, Logging, Clockwork to track data flow and so on! Not counting the wide range of available development frameworks (Inertia, Vue.js). The sky is the limit!
Resources for Further Study
Laravel and its various ecosystem components have some of the nicest documentation in tech. There are also tons of YouTube educators teaching Laravel, including the popular Laracasts channel.
https://laravel.com/docs : Official documentation, beautiful!
Encouragement and Final Thoughts
Laravel is a great backend framework with many use cases and a lively community of developers and teachers. The more you use it, the more you'll discover features that will impress you! Do try and be mesmerized!