Laravel Framework is a popular PHP framework that is taking the web development community by storm. Laravel is the Most Starred PHP Framework on Github: more than 30 000 developers from all over the world (mostly from the USA) use it for custom software development.
2. Laravel Framework is a popular PHP framework that is taking the web development
community by storm. Laravel is the Most Starred PHP Framework on Github: more than 30
000 developers from all over the world (mostly from the USA) use it for custom software
development.
Installing Laravel Homestead Virtual Machine
Installing Laravel from Composer
Using Artisan command-line interface
Creating Routes and Loading Views WITHOUT Controllers
Creating Routes and Loading Views WITH Controllers
Using Blade templating language to create templates
Adding/managing CSS and JS
Database Management and Operations
3. CRUD operations
Validation
Authentication and Authorisation
Using Laravel Middleware
Flash Messages
Service Container
Service Providers
Starter Kits
Community
4. #1 INSTALLING LARAVEL HOMESTEAD VIRTUAL MACHINE
Use Laravel Homestead (pre-packaged Vagrant box) as your development environment.
Vagrant is the command line utility for building and maintaining portable virtual
development environments.
Laravel Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx
web server, PHP 7.0, MySQL, Postgres, Redis, Memcached and a variety of other useful
utilities. With Laravel Homestead it is not required to separately install PHP, a web server,
and any other server software on your local machine.
https://laravel.com/docs/master/homestead
https://laracasts.com/series/laravel-5-fundamentals/episodes/2 (Video: Virtual
Machines and Homestead)
https://scotch.io/tutorials/getting-started-with-laravel-homestead
https://code.tutsplus.com/courses/get-started-with-laravel-5/lessons/working-from-
linux-or-os-x
5. #2 INSTALLING LARAVEL FROM COMPOSER
Laravel framework consists of many separate components that are downloaded and put
together automatically into a framework through a special tool called “Composer” (a tool
for dependency management in PHP). So, before using Laravel, make sure you have
Composer installed on your machine.
https://laravel.com/docs/master/installation
https://laracasts.com/series/laravel-5-fundamentals/episodes/1 (Video: Meet
Composer)
https://laracasts.com/series/laravel-5-from-scratch/episodes/1(Video: Initial Setup)
https://daylerees.com/code-smart-composer/
6. #3 USING ARTISAN COMMAND-LINE INTERFACE IN LARAVEL
Artisan is the command-line interface included with Laravel. Artisan offers many
useful commands that can help you perform various tasks, such as generating
migrations or publishing a package's assets. In addition to the built-in commands, you
can extend Artisan with your own commands.
Artisan comes with Laravel by default. If your php command works fine, then the only
thing you need to do is to navigate to the project's root folder. The root folder is the
parent folder of the app folder.
• https://laravel.com/docs/master/artisan
7. #4 CREATING ROUTES AND LOADING VIEWS WITHOUT
CONTROLLERS IN LARAVEL
The "hello world" for frameworks is to figure out how to process a given URI, and
display the appropriate HTML on the page.
Routes define the endpoints of a web application, the final destinations of incoming
requests. All Laravel routes are defined in the route files, which are located in
the routes directory. These files are automatically loaded by the framework. For
most applications, you will begin by defining routes in your routes/web.php file.
Views are used to build up the resulting page that the user will see in their browser
when they click on a link or submit a form. Typically a view is the HTML response
returned by the application to the browser initiating the request. Views can be
loaded directly from the routing file. Views are stored in
the resources/views directory. View files have a .php file extension or a .blade.php
file extension if you use the Blade templating engine.
8. Using route closures (defining all of your request handling logic as closures in route
files, without controllers) is very useful for small projects that don't require too much
functionality. Closure based routes cannot be cached. To use route caching, you must
convert any closure routes to controller classes.
https://laravel.com/docs/master/lifecycle
https://laravel.com/docs/master/routing
https://laravel.com/docs/master/views
https://laracasts.com/series/laravel-5-from-scratch/episodes/2 (Video: Your First
View and Route)
https://laracasts.com/series/laravel-5-fundamentals/episodes/4 (Video: Passing Data
to Views)
https://scotch.io/tutorials/simple-and-easy-laravel-routing
https://school.scotch.io/laravel-routing/getting-started
https://daylerees.com/code-smart-basic-routing/
9. #5 CREATING ROUTES AND LOADING VIEWS WITH
CONTROLLERS IN LARAVEL
For most projects you may wish to organize request handling logic using controllers.
Controllers are PHP classes that contain application’s logic and are called from the
application’s routing files. Controllers contain methods called “actions” that direct the
execution flow of a web application by working with application’s data (models),
producing output (views) or redirecting. Controllers can group related request handling
logic into a single class. The controllers need to be connected to the routing mechanisms in
order to be executed when the application runs. Controllers are stored in
the app/Http/Controllers directory.
By creating a controller and specifying which routes in the routing file use its member
functions you are able to take full advantage of MVC pattern in your Laravel applications.
10. Another important advantage of using controllers with routes instead of putting all code
into the “route.php” file is that using separate PHP classes to build application’s
functionality brings the full benefits of Object Oriented Programming (OOP) such as
dependency injection, encapsulation, inheritance and more. This aspect of application
architecture is incredibly important for developers who practice good design patterns in
their applications.
If your application is using controller based routes, you should take advantage of Laravel's
route cache. Using the route cache will drastically decrease the amount of time it takes to
register all of your application's routes. In some cases, your route registration may even be
up to 100x faster.
https://laravel.com/docs/master/controllers
https://laracasts.com/series/laravel-5-fundamentals/episodes/3 (Video: A Gentle
Introduction to Routing, Controllers, and Views)
https://laracasts.com/series/laravel-5-from-scratch/episodes/4 (Video: Routing to
Controllers)
11. #6 USING BLADE TEMPLATING LANGUAGE TO CREATE
TEMPLATES IN LARAVEL
Laravel uses its own view template engine called “Blade”. Blade template
engine is fantastic for reducing or simplifying the code that you write in your
view. Blade template engine also allows you to easily create layouts, extend
them and include partials to prevent you from repeating the same HTML in
multiple files.
Using Blade makes it is possible to combine many templates (for example,
header.blade.php, footer.blade.php and sidebar.blade.php) into a single HTML
output. To reduce duplication, Blade provides "layout files." Within these files,
you can define the wrapping HTML, which nests the content from each of your
views.
13. #7 ADDING/MANAGING YOUR CSS AND JS FILES IN LARAVEL
When it comes to including your assets (CSS and JavaScript files), you can create
directories within your public folder and add it directly in your view file. This is great for
small projects.
But if you need to use CSS preprocessors, or concatenate some files and minify them,
Laravel Elixir (a tool to integrate Gulp into your Laravel projects, a task runner built
as a wrapper around Gulp) will help you.
14. Gulp is a well-known JavaScript-based task runner - an automated tool for
performing repetitive tasks like concatenation, minification, unit testing, linting etc.
With Gulp you can create tasks to watch, compile, concatenate, minify and auto-
prefix your CSS and Sass/Less, concatenate and minify JS, minify HTML and
optimize images.
Elixir is built on top of Gulp, so to run your Laravel Elixir tasks you only need to
run the gulp command in your terminal. Make sure that you install Gulp globally
first.
• https://laravel.com/docs/master/frontend
• https://laravel.com/docs/master/elixir
• https://laracasts.com/series/laravel-5-from-scratch/episodes/6 (Video: How to
Manage Your CSS and JS)
• https://laracasts.com/series/laravel-5-fundamentals/episodes/19 (Video: Manage
Your Assets)
• https://www.sitepoint.com/meet-elixir-the-laravel-way-of-compiling-assets/
15. #8 DATABASE MANAGEMENT AND DATABASE OPERATIONS IN
LARAVEL
Currently, Laravel supports four database systems: MySQL, Postgres, SQLite, SQL Server.
The database configuration for your application is located at config/database.php. In this
file you may define all of your database connections, as well as specify which connection
should be used by default.
Laravel interprets the data stored in the database into objects that you can easily manipulate
like you would manipulate any other PHP object. This allows the developer to focus on
other parts of the application instead of figuring out complex Structured Query Language
(SQL) queries necessary to work with the data.
Laravel comes with two powerful sets of features to execute database operations, by using
its own Query Builder or by using concept of “models” in Eloquent ORM. You can use
both in the same application (even combine both to get the most flexibility out of DB
operations).
16. Laravel’s Query Builder provides a clean and simple interface for executing database
queries. It is a powerful tool that can be used for various database operations such as
retrieving records, inserting new records, deleting records, updating records, performing
“Join” queries, executing raw SQL queries, filtering, grouping and sorting of records
Laravel makes interacting with databases extremely simple using the Eloquent ORM (the
most preferred way to fetch data and render it in the view). The Eloquent ORM
provides an Active Record implementation to work with your database. This means that
each model corresponds to a table in your database. We can use Eloquent to interact with
our database and do the basic CRUD functions, set up and use one-to-one relationships,
one-to-many relationships, AND many-to-many relationships.
Some of the advanced database operations that Laravel provides out of the box are
managing database tables and fields through special files called “migrations”, populating
database with sample data (also called “seeding”), working with separate read/write
databases, pagination, many different relationship types and advanced methods of querying
relations, database transactions and query logging.
19. #8.1 LARAVEL CRUD OPERATIONS
Forms exist in just about every single web application. How does it work in Laravel? Let's
review the basic workflow for submitting a form, fetching the data that was sent through,
and then creating a record in the database.
You'll of course need to modify existing records in the database. Let's review the process of
creating an "edit" page to handle this very task. Along the way, we'll also get a chance to
review PATCH requests and the concept of eager loading and the problems it solves.
Along the way, you'll be introduced to custom packages, service providers, and much more.
https://laracasts.com/series/laravel-5-from-scratch/episodes/9 (Video: Forms)
https://laracasts.com/series/laravel-5-fundamentals/episodes/10 (Video: Forms)
https://laracasts.com/series/laravel-5-from-scratch/episodes/10 (Video: Updating
Records and Eager Loading)
20. #8.2 VALIDATION IN LARAVEL
Laravel provides several different approaches to validate your application's incoming data.
Let's look at a complete example of validating a form and displaying the error messages
back to the user.
https://laravel.com/docs/master/validation
https://laracasts.com/series/laravel-5-from-scratch/episodes/11 (Video: Validation
and More)
https://laracasts.com/series/laravel-5-fundamentals/episodes/12 (Video: Form
Requests and Controller
Validation)
https://www.youtube.com/watch?v=UzoktoyzUM0 (Video: Add Validation Request
Rules)
21. #8.3 AUTHENTICATION AND AUTHORISATION IN LARAVEL
Most applications will require some form of authentication. With Laravel, it is
simple. Let's setup registration, authentication, and password resets in minutes.
https://laravel.com/docs/master/authorization
https://laravel.com/docs/master/authentication
https://laravel.com/docs/master/mail
https://laracasts.com/series/laravel-5-from-scratch/episodes/13 (Video:
Authenticate Your Users)
https://laracasts.com/series/laravel-5-fundamentals/episodes/15 (Video:
Easy Auth)
22. #9 USING LARAVEL MIDDLEWARE
Middleware provide a convenient mechanism for filtering HTTP requests entering your
application.
There are many more cases where you would like to use a middleware: changing the site
language based on locale, enabling site-wide maintenance, sniffing bot traffic, logging etc.
There are several middleware included in the Laravel framework, including middleware for
authentication and CSRF protection. All of these middleware are located in
the app/Http/Middleware directory. Additional middleware can be written.
https://laravel.com/docs/master/middleware
https://laracasts.com/series/laravel-5-from-scratch/episodes/14 (Video:
Understanding Middleware)
https://laracasts.com/series/laravel-5-fundamentals/episodes/16 (Video: Ogres Are
Like Middleware)
https://scotch.io/tutorials/understanding-laravel-middleware
23. #10 LARAVEL FLASH MESSAGES EXAMPLE
Often, you'll want to send a quick notification to the user when they perform some
kind of action in your application. "Good job, your task has been
created." Or: "You are now logged out." So it seems that we need a way to store
things in the session for just a single request. There are some clean ways to handle
this in Laravel!
https://laravel.com/docs/master/session
https://laracasts.com/series/laravel-5-from-scratch/episodes/15 (Video:
Flashing to the Session)
https://laracasts.com/series/laravel-5-fundamentals/episodes/20 (Video:
Flash Messaging)
24. #11 LARAVEL SERVICE CONTAINER
Laravel's service container (also known as the IoC container) is the heart of Laravel. It is a
powerful tool for managing class dependencies and performing dependency injection.
Basically the IoC Container is just an ordinary PHP class. But we can place or “Bind” in it
everything we need from interfaces implementations to directories paths and so on. Now,
since we have a single Object that contains all of our various bindings, it is very easy to
retrieve them back or “resolve” them at any point in our code.
https://laravel.com/docs/master/container
https://laracasts.com/series/laravel-5-from-scratch/episodes/16 (Video: Automatic
Resolution and the Service Container)
https://laracasts.com/series/laravel-5-fundamentals/episodes/26 (Video: The
Service Container)
http://stackoverflow.com/questions/37038830/what-is-the-concept-of-service-
container-in-laravel
http://stackoverflow.com/questions/31685073/laravel-5-1-service-container-
binding-using-something-other-than-the-class-name
25. #12 LARAVEL SERVICE PROVIDERS
Service providers are the central place of all Laravel application bootstrapping. Your own
application, as well as all of Laravel's core services, are bootstrapped via service providers.
But, what do we mean by "bootstrapped"? In general, we mean registering things, including
registering service container bindings, event listeners, middleware, and even routes. Service
providers are the central place to configure your application. For example, when installing a
package, you have to give application access to that package - one of the best solutions is
through Service Providers list and a Facade.
Laravel ships with many facades which provide access to almost all of Laravel's features.
In a Laravel application, a facade is a class that provides access to an object from the
container.
26. Facades have many benefits. They provide a terse, memorable syntax that allows you to use
Laravel's features without remembering long class names that must be injected or
configured manually. Furthermore, because of their unique usage of PHP's dynamic
methods, they are easy to test. However, some care must be taken when using facades.
https://laravel.com/docs/master/providers
https://laravel.com/docs/master/facades
https://laracasts.com/series/laravel-5-from-scratch/episodes/17 (Bootstrapping With
Service Providers)
https://laracasts.com/discuss/channels/lumen/why-use-service-providers-any-
examples
http://taylorotwell.com/response-dont-use-facades/
27. LARAVEL STARTER KITS
Videos are obviously useful without a doubt. However, many will agree that nothing
compares to a working example of a functional code.
https://github.com/bestmomo/laravel5-3-example
https://github.com/laravel/quickstart-basic
https://github.com/sroutier/laravel-5.1-enterprise-starter-kit
https://github.com/mrakodol/Laravel-5-Bootstrap-3-Starter-Site
https://github.com/invoiceninja/invoiceninja
https://github.com/msalom28/Larasocial
http://crudbooster.com/
28. http://quickadmin.webcoderpro.com/
https://gist.github.com/msurguy/8590765
https://scotch.io/tutorials/build-a-support-ticket-application-with-laravel-part-1
https://www.youtube.com/watch?v=_dd4-HEPejU (Laravel 5.2 PHP Build a social
network - Setup & Introduction)
https://www.youtube.com/watch?v=R8B4og-BeCk&list=PLwAKR305CRO-Q90J-
--jXVzbOd4CDRbV (How to Build a Blog with Laravel)
29. LARAVEL COMMUNITY
Laravel Community are free discussion forums for asking and answering questions about
using Laravel framework.
https://laracasts.com/community
https://www.quora.com/topic/Laravel
https://www.reddit.com/r/laravel/
http://stackoverflow.com/questions/tagged/laravel
https://laravel.io
https://www.linkedin.com/groups/6553973/profile
TWITTER ACCOUNTS TO FOLLOW
Taylor Otwell, Dayle Rees, Shawn McCool, Jeffrey Way, Chris Fidao, Phil
Sturgeon, Jens Segers, Ben Corlett, Matt Stauffer, Graham Campbell, Belitsoft,
Advanceideainfotech
30. DO YOU NEED TO READ SOME PDF BOOKS ABOUT LARAVEL?
https://leanpub.com/book_search?search=laravel+5
https://tutsplus.com/tutorials/search/Laravel+5
https://www.packtpub.com/mapt/book/web_development/9781785
283017/1
https://leanpub.com/laravel-first-framework
31. Top PHP Web Development Company
–Advance Idea InfoTech.
Contact on : +91 709-696-2080
Email : info@advanceidea.co.in
Website : www.advanceidea.co.in
LinkedIn : https://www.linkedin.com/company/advance-idea-infotech