Professional Documents
Culture Documents
UNIT 1 - Intro and Installation
UNIT 1 - Intro and Installation
Overview/Introduction
This course provides an overview and discussions of the web development framework Laravel.
This course include: brief history of web frameworks, introduction on PHP frameworks, the
development framework Laravel, Installation via composer, initial configuration, directory
configuration, Laravel file Structure, local development environment, Git bash, PHP artisan
commands, Routes, Middleware, CSRF protection, Controllers, Requests, Responses, Views, Blade
Templates, Session, Validation, Error Handling, Models, Database Migrations, Eloquent, and Simple
App Testing. This course focuses on developing a web application using Laravel framework with
CRUD+S – create, read, update, delete and search functionality as final output in the course
subject.
Lesson/Topics:
Unit overview
Unit1 identifies and describes what is web development framework currently used in today’s
development of web applications. It specifically discuss the PHP framework Laravel as the main
web development framework for developing web applications. This unit also includes benefits
and installation, initial configurations and directory configuration in order to use Laravel.
Learning Outcomes
Frameworks have become an essential part of web development, as the standards of web
applications are always rising, so does the complexity of the technology needed. It’s completely
unreasonable to reinvent the wheel for such sophisticated techniques -assuming that you can
reinvent all that. That’s why using frameworks endorsed by thousands of developers around the
world is a very sensible approach for building rich and interactive web applications. A web app
has a backend (server-side) and a frontend (client-side), so we discuss both best Backend
frameworks as well as frontend frameworks. Here goes the list of best web development
frameworks in 2021:
Web frameworks
A web framework (WF) or web application framework (WAF) is a software framework that is
designed to support the development of web applications including web services, web resources,
and web APIs. Web frameworks provide a standard way to build and deploy web applications
on the World Wide Web.
From RESTful APIs to complete MVC frameworks, here are some of the most robust backend
frameworks in 2021 that you might be interested to learn.
1. Express
Thanks to the skyrocketing popularity
of Node.js, Express is quickly
becoming one of the most trending
best framework for web
development nowadays. It is popular
amongst Accenture, IBM and Uber,
and many other companies, and it’s
also compatible with other
frameworks such as Kraken, Sails, and
Loopback.
Express prides itself as a minimal, fast,
and unopinionated framework. It
provides some core framework
functionalities without obscuring the
features of Node and leverages the robust performance of the asynchronous Node.js. It’s also
quite flexible and supports full applications as well as REST API, as well. Perhaps the biggest
drawback of Express is the fact that there’s no defined way of doing things, at least for beginners.
2. Django
Django is a Model-View-Template
framework that uses Python for
web development. Big names such
as Google, Youtube, and
Instagram use this framework.
Django boasts its batteries-
included feature, which is a bunch
of features such as authentication
and messaging that Django has. It
follows the Convention Over
Configuration pattern
and the DRY pattern as well. Security in Django is essential. Django provides techniques and tools
for developers to build a secure website or implements the security features in the framework itself,
like preventing code execution in the template layer.
3. Rails
Rails is a Model-View-Controller
framework that uses Ruby, and it’s a
popular framework that is loved by
many developers. Airbnb, GitHub,
Hulu, and Shopify are primary users of
Rails. Rails is considered a beginner-
friendly framework, and the fact pros
and cons are debated, helps
beginners get started with web
development quite quickly. There
are many useful gems for rails, which are library-like dependencies that extend the functionalities
of your application and helps you develop even faster and more efficiently. The Rails community
is quite reliable and friendly, and there are many tutorials, screencasts, and resources that can
help you become a rails expert in no time.
The main disadvantage of rails lies in the fact that they take quite some effort to deploy and run
in a production environment, and the learning curve of rails becomes steep once you dive deeper
into the framework to unravel the magic behind it.
4. Laravel
5. Spring
Spring is a Model-View-Controller framework that
uses Java, the all-time popular language. Websites
like Wix, TicketMaster, and BillGuard are users of this
framework. Spring possesses many sister projects
that boost its performance and let you scale your
business quickly. The fact that it uses Java, a strongly
typed language, is a severe pro to many web
developers. The learning curve might be quite
steep tho, especially if you don’t know Java.
6. Angular
Angular is a front-end framework that
specializes in building rich Single-Page
applications. It’s a vibrant framework
able to build complete client-side
applications, and there’s so much to
do and learn in Angular. Angular 1.x
used Javascript, but later releases
adopted Typescript, which is a superset
of Javascript. Angular’s main cons are
its size compared to other frameworks,
and the fact it’s not SEO friendly by
nature, though it can be SEO
optimized. Google developed angular, and Google, Microsoft, and Paypal use it.
7. React
React is not a framework, it’s a frontend
library, but many developers consider it a
framework and it’s usually compared in
that context. React was the first to adopt
the component-based architecture that
Angular and Vue, and many other
frameworks started to adopt later on.
React’s virtual dom makes the dom-
manipulation much faster, and it’s quite
easy to pick up, mainly thanks to its JSX
syntax. React could be used server-side or client-side. It was developed and maintained by
Facebook, and Facebook and Instagram use it.
8. Vue
10. Backbone
For years now, PHP has been one of the most used programming languages for developing
websites and applications. Although the language is considered to be quite stable and secure, it
has seen a fair share of evolution since its release. But as time has passed, the complexity of
websites has increased massively. Developers have to write hundreds and thousands of lines of
code to create these websites, which is a tedious task and takes a lot of time. Moreover,
developers have to start from scratch every time. This is where PHP frameworks come into the
picture.
1. Laravel Topping our list is the new yet extremely popular (if not the most popular)
framework, Laravel. Released in 2011, Laravel
has swept the framework arena off its feet and
has been topping charts for quite some time
now. The immense popularity can be attributed
to its ability to handle complex web
applications with additional security and speed
when compared to other frameworks. It also
simplifies the process of development by
reducing the complexity of commons tasks,
such as sessions, routing, queuing and
authentication.
Developers also prefer Laravel as it offers a vast ecosystem, which brings instant hosting and
deployment platform, along with screencast tutorials hosted by the official Laravel website. The
framework also features Homestead, a Vagrant box (prepackaged development environment)
which assists in hassle-free development. Other features include a strong encryption package(s),
overloading capabilities using dynamic methods and tons of out of box functionality. It is easy, to
begin with Laravel due to the availability of extensive documentation and plenty of online Laravel
tutorials resources to learn.
2. Symfony Launched in 2005, Symfony has existed far longer than most
PHP frameworks in the business, which showcases that it has held
the trust of developers for over a decade, maturing with its age.
The framework is an extensive PHP framework, and it is the sole
framework which follows the standards of PHP and web
completely. Symfony components are used by popular content
management systems such as Drupal, OroCRM, and PHP Bulletin
Board (PHPBB).
Symphony is the first choice for many developers due to the
availability of reusable libraries and components using which
you can complete a variety of tasks such as authentication,
templating, object configuration and much more. Symfony
comes out as the perfect choice among PHP frameworks when
it comes to large-scale enterprise assignments. Moreover, the
Symfony ecosystem is massive and is supported by a highly active programming community and
has tons of great online Symfony tutorials for you to get started.
3. CodeIgniter CodeIgniter is a lightweight framework that's known for its
small footprint and hassle-free installation with minimalistic configuration
prerequisites. Simple yet powerful, CodeIgniter is a mere 2MB in
size, which even includes the documentation. It is highly suitable for
the development of dynamic websites, as it offers many prebuilt
modules that help in the construction of strong and reusable
components.
Due to its concentration in enterprise applications, it comes with a surplus of components for tasks
such as authentication, services, forms and much more. But even though it comes with many tools
that make the life of a developer fairly easy, it is still not ideal for rapid application development.
Zend framework packs feature such as an easy to use drag and drop editor, coding tools, online
debugging tools and a scalable interface useful for complicated websites. However, the Zend
framework is considered one of the most difficult frameworks to learn, especially if you are a
beginner.
Even though Slim is minimalistic in nature, it is packed with rich features such as URL routing, session,
and cookie encryption, client-side HTTP caching and the support to ‘flash’ messages across HTTP
requests. The framework is highly used by developers who aim to develop RESTful APIs and services.
An active user base and constant maintenance and updates make it extremely user-friendly. Slim
has good tutorials for beginners.
8. Aura Unlike other PHP frameworks we have mentioned, Aura is a collection of decoupled
libraries for PHP. Aura is frequently updated and maintained is
perfect for rudimentary applications. The primary feature of Aura
is that every available library is self-contained and may be used
independently in any project, without any dependencies.
Furthermore, it comes with an extremely powerful class code generator known as Gii. The function
of Gii is to ease out the process of object-oriented programming and rapid prototyping, which
provides a web-based interface, helping the programmer generate the desired code
interactively. Other features include a short rapid development time, availability of multiple
packages for security and sets of configuration for speeding things up.
CakePHP is a good option for commercial application projects as it offers high-end security with
features such as SQL injection prevention, cross-site request forgery protection and cross-site
scripting protection among many others. Other features include proper class inheritance,
validation, and fast builds. The framework receives premium support from its parent company and
has many support portals as well. You can find CakePHP tutorials on Hackr.io.
c. Benefits of Using Web Frameworks For Web Application Development
Unlike many other development tools, frameworks provide a pre-defined codebase and
guidelines to facilitate seamless web development. At the same time, it accelerates the
development process and reduces time-to-market by shortening the application development
lifecycle. Below are the key benefits of using frameworks for web application development.
Web application
development using
frameworks focuses
primarily on improving code
quality and readability for
developers’ convenience.
In addition to providing the
most efficient way to code
and develop web
applications, frameworks
facilitate easy debugging
and software maintenance.
Several web frameworks
render built-in support for debugging and QA testing, enabling developers to perform unit tests
simultaneously. Nevertheless, high-level software testing requires QA engineers that are skilled at
using tools like Selenium, JMeter, and Katalon Studio.
Source: Stackoverflow
The above image clearly describes debugging process in Python language using the Django
framework.
Web frameworks have their main focus on improving code readability and reusability, thereby
providing the fastest and most efficient
way to develop self-sustaining web
applications. Besides, developers get a
responsive coding environment and
advanced features like hot reload, live
reload that ultimately lead to faster
web development.
Source: GitHub
With web frameworks at their disposal, developers do not need to write complex code structures
containing hundreds of lines of code. Instead, they can use the pre-defined codebase and make
easy modifications to perform seamless bootstrapping. Many popular frameworks like Django and
React.js provide easy code reusability, enabling developers to use the same codebase to
develop multiple web apps. Similarly, web frameworks focus on reducing development
complexities by automating critical tasks like caching, URL mapping, session management, and
more.
3. Accelerated Development
One of the main advantages of using web frameworks is that you don’t need to write extensive
lines of code. With a pre-defined template and an intuitive coding interface, developers can save
hours of strenuous coding effort. Besides, frameworks offer quick prototyping, easy debugging,
and real-time code changes to implement custom functionalities.
4. Enhanced Security
What is Laravel?
Laravel is a web application framework with expressive,
elegant syntax. A web framework provides a structure and
starting point for creating your application, allowing you
to focus on creating something amazing while we sweat
the details.
Why Laravel?
There are a variety of tools and frameworks available to you when building a web application.
However, we believe Laravel is the best choice for building modern, full-stack web applications.
For more details and information about Laravel please visit: https://laravel.com/
A Progressive Framework
We like to call Laravel a "progressive" framework. By that, we mean that Laravel grows with you. If
you're just taking your first steps into web development, Laravel's vast library of documentation,
guides, and video tutorials will help you learn the ropes without becoming overwhelmed.
If you're a senior developer, Laravel gives you robust tools for dependency injection, unit testing,
queues, real-time events, and more. Laravel is fine-tuned for building professional web
applications and ready to handle enterprise work loads.
A Scalable Framework
Laravel is incredibly scalable. Thanks to the scaling-friendly nature of PHP and Laravel's built-in
support for fast, distributed cache systems like Redis, horizontal scaling with Laravel is a breeze. In
fact, Laravel applications have been easily scaled to handle hundreds of millions of requests per
month.
Need extreme scaling? Platforms like Laravel Vapor allow you to run your Laravel application at
nearly limitless scale on AWS's latest serverless technology.
A Community Framework
Laravel combines the best packages in the PHP ecosystem to offer the most robust and developer
friendly framework available. In addition, thousands of talented developers from around the world
have contributed to the framework. Who knows, maybe you'll even become a Laravel
contributor.
About Laravel version 8.55.0
Laravel is accessible, yet powerful, providing tools needed for large, robust
applications. A superb combination of simplicity, elegance, and innovation
gives you a complete toolset required to build any application with which you
are tasked.
Laravel framework is very popular for custom software development. It is the Most Starred
PHP Framework on Github: more than 56 000 developers from all over the world (mostly
from the USA) greatly appreciate robust features of this platform. Why is Laravel so
popular? It gives the right tools to help build websites and web apps faster, more stable
and very easy to maintain.
Authorization.
Mail Services.
Speed.
Security.
Error/Exception Handling.
Automation testing.
URL Routing Configuration.
MVC framework.
Laravel benefit #1: Laravel makes implementing authentication very simple. Almost
everything is configured out-of-the-box. Laravel also provides a simple way to organize
authorization logic and control access to resources.
Laravel benefit #2. Laravel provides a clean, simple API over the popular SwiftMailer
library. Laravel also provides drivers for SMTP, Mailgun, Mandrill, SparkPost, Amazon SES,
PHP's “mail” function, and “sendmail”, allowing an application to quickly get started
sending mail through a local or cloud-based service. In addition to support for sending
email, Laravel provides support for sending notifications across a variety of delivery
channels, including SMS (via Nexmo) and Slack.
Laravel benefit #3. Laravel supports popular cache backends like Memcached and
Redis out-of-the-box. By default, Laravel is configured to use the file cache driver, which
stores cached objects in the file system. For larger applications, it is better to use an in-
memory cache such as Memcached or APC. However, with Laravel it is even possible to
configure multiple cache configurations..
Laravel benefit #4. Laravel helps to secure the web application by protecting it against
the most serious security risks: SQL injection, cross-site request forgery, and cross-site
scripting. Laravel itself is secure. We can tell you first hand that the codebase is fanatically
guarded, and that the code has been vetted by several people.
Laravel benefit #5. Error and exception handling is already configured for any new
Laravel-based project. In addition, Laravel is integrated with the Monolog logging library,
which provides support for a variety of powerful log handlers.
Laravel benefit #6. Laravel is built with testing in mind. In fact, support for testing with
PHPUnit is included out-of-the-box and a phpunit.xml file is already setup for the
application. The framework also ships with convenient helper methods allowing for
expressive testing of the applications. It provides easy ways for simulating basic behavior
of users (making requests to the application and examining the output, for example,
clicking links, filling out forms).
Laravel benefit #9. The Laravel queue service provides a unified API across a variety of
different queue backends. Queues allow you to defer the processing of a time-
consuming task, such as sending an e-mail, until a later time, which drastically speeds up
web requests to your application.
Laravel benefit #10. In the past, developers have generated a Cron entry for each task
they need to schedule. However, this is a headache. Such task schedule is no longer in
source control, and developers must SSH into the server to add the Cron entries. The
Laravel command scheduler allows for the fluent and expressive defining of command
schedule within Laravel itself, and only a single Cron entry is needed on the server.
Process 2 –
Download a dependency manager for PHP
“composer” latest version: 2.1.5. Please visit the link for
the download link and look for Composer-Setup.exe to
download, please refer to the link for your reference:
https://getcomposer.org/
f. Initial configurations
g. directory configuration
References
https://laravel.com/
https://hackr.io/blog/best-php-frameworks
https://jellyfish.tech/web-development-evolution-from-2000s-to-2020/
https://erpsolutions.oodles.io/blog/web-development-frameworks-benefits/