Laravel Frame Work Development Tips - iprismtech.com - PowerPoint PPT Presentation

About This Presentation
Title:

Laravel Frame Work Development Tips - iprismtech.com

Description:

In PHP one of the best frame works is Laravel. If you need Laravel tips please watch this PPT. In this PPT explain some Laravel tips. – PowerPoint PPT presentation

Number of Views:67
Slides: 10
Provided by: iPrismTechnologies
Category: Other

less

Transcript and Presenter's Notes

Title: Laravel Frame Work Development Tips - iprismtech.com


1
Laravel Development Tips
  • www.iprismtech.com

2
Laravel Development Tips
  • Laravel is a web application framework with
    expressive, elegant syntax. We believe
    development must be an enjoyable, creative
    experience to be truly fulfilling. Laravel
    attempts to take the pain out of development by
    easing common tasks used in the majority of web
    projects, such as authentication, routing,
    sessions, and caching.
  • Tips for Laravel Development
  • Cache in Laravel
  • Databases Configuration
  • Requests Inputs in Laravel
  • Responses in Laravel
  • Controllers in Laravel
  • Basic Routing in Laravel

3
Laravel Development Tips
Cache in Laravel Cache is basically an another
layer between our website and database. Database
queries can be slow, especially when we have lots
of traffic.The cache layer basically act as a
middle layer to store data that has not been
changed between requests. Retrieving data from
cache rather than a database is much quicker .
There are all kinds of ways to cache data, and
laravel makes it easy to do so with small number
of method calls. Cache Configuration in Laravel
Laravel provides a unified API for various
caching systems. There is no need to change our
code if we want to change between different
caching systems. All the cache configuration
located at app/config/cache.php. As we can see by
default laravel uses file storage system for
cache. The other caching systems options are
memcached, apc, redis, array and database.
4
Laravel Development Tips
Databases Configuration We have to use database
to save data for further processing based on the
requests and we have to send the specific data as
a response. Databases are simply grids of data,
not pretty. Fortunately, these days we are
spoiled by lovely ORMs that will allow us to
access our database rows as object instances.
Laravel framework has it's own ORM called
Eloquent. Laravel has lots of options to work
with different databases like MySQL, SQLite,
PostgreSQL and SQL Server. As you can see now
you have lot of choices when selecting a database
platform. In this tutorial we are going to use
MySQL to explain examples. But we can easily
shift in between different databases. Laravel
abstraction layer automatically provided SQL
syntax based on the database we choose. Another
advantage of laravel abstraction layer is
security. We don't have to worry about escaping
the values that we send to the database. Laravel
will escape the values for us, in an effort to
prevent various forms of injection attacks.
5
Laravel Development Tips
Requests Inputs in Laravel In any web
application data and it's manipulation is
important. Data doesn't always to be a long term
thing. The data provided from an HTML form, or
attached to a request is, by default, only
available for the duration of the request. Before
we can work on data from the request, we will
first need to retrieve it.Let's see how we can
work on data in Laravel framework. Retrieval
Let's see how we can retrieve some GET data
from our URI. This type of data is appended to
the URL in the form of key/value pairs. //
app/routes.php Routeget('/', function()
data Inputall() var_dump(data) )
6
Laravel Development Tips
Responses in Laravel URl's using Closures and
Controllers actions when we got a Request using
web server. But at the same we are also sending a
response to every request. But today we will
discuss in detail about the responses in
Laravel.? Let's go to our first web request
http//domain.com/blog/ and see what kind of
response we are sending via route closure
below. // app/routes.php Routeget('/',
function() return 'Blog Home Page!'
) Here in the above example we are returning
a statement called 'Blog Home Page!' to the
browser when we get request using a route closure
or controller action always.
7
Laravel Development Tips
Basic Routing in Laravel I assume you have a
new laravel application folder for testing
purpose. Let's take a look at a request being
made to the Laravel framework. http//domain.com
/blog/page In this example we are using the
http protocol using by most web browsers to
access your laravel application hosted on
domain.com. The blog/page portion of the URL
which we use to route web requests to appropriate
logic. Redirect to URL We can redirect to path
using Redirectto("path") and to route using
Redirectroute("route") . What if you want to
redirect to external url then we use
Redirectaway() Redirectaway('http//www.kodei
nfo.com')
8
Laravel Development Tips
Visit www.iprismtech.com Whatsapp/Call
8885617929 Like facebook.com/iprismtech Tweet
Twitter.com/iprismtech
9
Laravel Development Tips
Thank You For Watching
Write a Comment
User Comments (0)
About PowerShow.com