Our Blog

Before you can visit any page or post of your laravel application you will have to specifies the route for individual static page or dynamic post.

Laravel determines the way to control the the contents by assigning them to a controller.Each Controller in laravel consist of different function that controls the various data on the type of methods such as-:

  1. GET  Request  => To Show Data
  2. POST  Request=>To Store The data Inside The Database
  3. PUT Request    => To Update The Data
  4. DELETE Request=>To delete the Data

In order to Pass the requested data to the specified controller we will have to define what is called Routes

Basic Routing-:

The simplest route that can be define is:

Route::get(‘/home’,function(){

return view(‘welcome’);

});

In above route ‘/home’ is the url that appears to user something like “http://www.yourdomain.com/home”

Route::get() is defined for the GET method similarly we can define something like Route::post(),Route::put(),Route::delete() for POST, PUT and DELETE request

The Above route says that when user visits the url ” http://www.yourdomain.com/home” return the content inside the welcome.blade.php

If you want to to go to controller through route you can define something like

Route::get(‘/home’,pagecontroller@index);

where “pagecontroller” is the name of controller and “index” is the method defined inside the pagecontroller

 

Resource Routing

Suppose that you are working on big project which consists of hundreds of form that it might become a heavy task to define individual route for the CRUD(Create-Read-Update-Delete) functionality.

Resource routes comes in handy when you need to define the controller that handles the Crud functionality.

To generate resourceful controller : php artisan make:controller –resource;

To define the route for resource controller: Route::resource(‘form’,’formController’);

The above resource would define the List of following individual route which you would have probably defined if working individually:

Route::get(‘form’,’formController@index’);

Route::get(‘form/create’,’formController@create’);

Route::post(‘form/store’,’formController@store’);

Route::get(‘form/{id}/edit’,’formController@edit’);

Route::put(‘form/{id}’,’formController@update’);

Route::delete(‘form/{id}’,’formController@destroy’);

 

June 25, 2017

Laravel Routing Techniques

Before you can visit any page or post of your laravel application you will have to specifies the route for individual static page or dynamic post. […]
June 23, 2017

Laravel tinker functionality

PHP is by far the most interactive way to communicate with server side and the interaction becomes more easy when you us some PHP based framework.ONE […]
May 31, 2017

FIX MAXIMUM EXECUTION TIME EXCEEDED ERROR IN WORDPRESS

The WordPress developers might have faced this issue of “Maximum execution time ” error while uploading a theme or installing a plugin. This error states like: “Maximum execution […]
May 27, 2017

SECURING AND ATTACKING WORDPRESS

Today, we will discuss about the attacking and securing the WordPress websites. The techniques I am going to discuss are used to attack and break the […]