Featured
-
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Best 5 Lightweight PHP Frameworks for REST APIs Development
Are you ready to develop the Rest AP
by ankur.kumar -
PHP: Full-Stack Framework vs Micro Framework
A web framework can be described as a software fra
by ankit.bhatia -
How to get facebook profile picture by Facebook App
If you would like to get your profile picture in f
by vivek.rastogi -
Creating RESTful API in cakephp
This tutorial will help you to learn how to create
by pushpendra.rawat
Tags
Paypal Checkout REST api integration in Laravel 5.7 with smart payment buttons
Hi All,
Paypal has updated their payment integration API to new REST API and existing APIs have been deprecated since Feb 2019. Due to less documentation, it was very hard to integrate these APIs with Laravel. After spending some time, I was a...
Reasons Why Enterprises Necessitate Laravel Development Services
Laravel PHP framework is developed to make a few development tasks easier for developers for example:
authentication, sessions, caching and routing.
That means web application development difficulties are resolved using ...
10 Best PHP Frameworks That Will Assist In Coding Effectively
Originally standing for Personal Home Page tools, PHP has come a long way. It is now used to refer to Hypertext Preprocessor. The language is very valuable in creating dynamic websites and interacting with other coding languages. Some people crea...
Web Development Benefits in Laravel PHP Framework
An open-source PHP framework, Laravel is considered to be one of the best web application frameworks out there. Its immense popularity can be attributed to a variety of reasons, such as the fact that it is not only easy to understand but also ser...
Why Laravel is Ruling as PHP Web Development Frameworks?
In this competitive world, PHP is ruling the web development like a boss. PHP is a well-known technology used for the website and web application development. Its the most used technology among various available technologies due to its great feat...
Configure Mailtrap SMTP to Send or Test e-Mail in PHP Laravel 5.4 App - 9 Easy Steps
Mailtrap is a fake or we can say test SMTP server which provides us "Developers" a service to send, test or share email messages to the mailbox, In a way that the real user does not get disturbed and mark the email spam. And to do that ...
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP, developed by Taylor Otwell and debuted in June 2011, with a aim to give an alternative of CodeIgniter Framework which will be more advanced and provides features like built-in-support for user a...
Association in Laravel
Association in Laravel
Laravel supports associations. Here associations are basically relationship between tables. There are six types of associations in Laravel:
Relationship
Type of Association
Example
...
Laravel 5.0 Illuminate, Facades, Service Container, Service Providers
Hi Readers,
If you are new to Laravel 5 you will definitely come across following terms and you will be using them without actually understanding what they stands for. But it always helpful to understand what are they stands for and why do...
Laravel 5.0 Difference between Fillable and Guarded
Hi Readers,
If you are new to Laravel you will definitely come across two properties in the model one is Fillable and another one is Guarded. I myself did not get the use of these properties but once I get along I understood the actual use...
laravel 4 - how to Limit (Take and Skip) for Eloquent ORM
Take and Skip are one of the functionality which is used when we are making Android API. By using Take And Skip we will fetch limited record according to our need.I can easily explain it by using simple example.
Example:
$start=$offset*10;
...
How to pass multiple optional parameters using Laravel 4.x
As we all know that routes plays an important role in any MVC framework. In Laravel we will define our routes in routes.php. Using Laravel 4.x we have the option to pass multiple optional parameters using Laravel 4.x.
By using example it can b...
Laravel join with 3 Tables
As we all know that when we are working on the big project then there is a need of join 2-3 table to get the result.
We can easily understand that by using example of joining 3 table.
Example:
$shares = DB::table('shares')
->join...
Query for multiple fields with Laravel 4.x
I have a situation where we have to make query for searching on the basis of multiple fields with Laravel 4.x. So for this we have many method either we will concatenate or we will use OR query in Laravel
Example:
$searchqueryResult =User:...
'Failed to open stream: Permission denied' error - Laravel
Some time when we want to access our public folder then we get the error "Failed to open stream: Permission denie' error - Laravel" . So when we get this error .Do not think much we have to clear our cache and just give permission to our folder a...
Laravel: Load method in another controller without changing the url
We can load method in another controller without changing the url using Laravel.
If you are using Laravel 3 then we will define:
Controller::call('ApplesController@getSomething');
If We are using Larval 4.x then we will define:
$req...
How to autoload 'libraries' in laravel 4
We can easily auto-load libraries in Laravel 4.x by using namespaces in our application. Then put all libraries you code under that namespace.
Suppose our directory structure would then be:
libraries
Myapp
Search (note directo...
Push Notification for Android using Laravel 4.x
There are few steps which we have to follow to implement Push Notification.
Step 1: First we will write the api to get token and device type . Here is the controller code of push notification.
public function pushNotification() {
$...
Using CSS in Laravel views.
CSS plays an important role in every project. In Laravel 4.x we will define our css in:
public/css/custom.css
Here In above path we will define our css in laravel 4.x
To call a view from controller we will use the code as follow:
Ex...
Laravel 4: how to order by using Eloquent ORM
In Laravel 4.x we have many facility to use query in a easy way. We will also run raw query in laravel 4.x. Laravel 4.x also provide of using order by query using Eloquent ORM.
We can easily understand this by seeing the example of order by...
How to define host and port using Laravel 4.x
Now a days there are n number of website which will move to android. So for every application we have to make API. If we will make our API in laravel 4.x then we will test using Postman. To define our port and to run our API using "Postman" we ha...
Update without touching timestamps (Laravel)
I want to update my data but I dont want to update my timestamps. Laravel 4.x provide us the facility to update our data without updating our timestamps.
The example to Update without touching timestamps using Laravel 4.x is:
$user = User::...
Laravel Creating Dynamic Routes to controllers from Mysql database
I want to create dynamic routes to controller from mysql database.We have the available following table for this.
id name route
--------------------
0 About about
1 Contact contact
2 Blog b...
eloquent laravel: How to get a row count from a ->get()
count is method which will return an array.It is a query builder. So to count rows from using a ->get() is
The syntax to count a row a -> get() is
$wordCount = count($wordlist);
If you have a wordlist model, then you can use Elo...
What to pass as parameters to the Url class?
There are n number of situation where we want to pass parameter in URL and use that parameter in our controller.That can be easily explain by using example:
There are few steps which I have implemented that are:
Step 1:First we will define...
Laravel 4 Eloquent Query Builder - Complicated joins with variable
As we all know joins play an important role in any project . So Laravel 4.x also provide Eloquent Query Builder in which we are able to use Complicated joins with variable.This can be easily explain by using example
Example:
I managed to fi...
laravel 4 artisan how to rollback to a specific migration state?
There are n number of command in laravel 4.x which can help us to perform any action . In laravel 4.x we can rollback our php artisan command. The command to rollback to a specific migration state is
You can:
1)Rollback The Last Migration ...
Change name of Laravel's created_at and updated_at
As we all know when we create table using php artisan and migration. Laravel create 2 column in the end of the database that column are created_at and updated_at .
We have a situation when we want to override these two names created_at and upd...
Laravel form model binding
Form Model Binding is one the important feature in Laravel 4.x. I am reading about this feature from the below link.
http://laravel.com/docs/html#form-model-binding
I have a situation where " The model (User) I want to bind in my form has a s...
How do I create a RESTful API in Laravel to use in my BackboneJS app
We have a situation where we want to create a RESTful API in Laravel 4.x and we have to BackBoneJS in my project .By using below step we can make RESTful API easily using BackboneJS.
This is an example for creating an API that stores bookmarks...
How to set a default attribute value for a Laravel / Eloquent model?
Laravel 4.x provide n number of services to solve basic issues. By using Laravel 4.x we will easily set a default attribute for a Laravel/Eloquent model.
To achieve this we have to define value like below example:
Example:
protected $def...
Laravel Controller Subfolder routing
Before I have written blog how to add sub-folder in our controller but not mention that how we will do Controller sub-folder routing.As we all know that routing plays an important role in any project. In Laravel 4.x sub-folder routing can be don...
'Failed to open stream: Permission denied' error - Laravel
Some time in Laravel 4.x we will get the error "Failed to open stream: Permission denied" error .When we have no permission then this type of error will occur. So to overcome this problem by using php artisan
are:
Step:
php artisan cache:...
Differences between php artisan dump-autoload and composer dump-autoload
When we are working on Laravel then we should know the php artisan and composer and the differences between php artisan dump-autoload and composer dump-autoload are:
Laravel's Autoload is a bit different:
1) It will in fact use Compose...
Retrieving GET and POST data inside controller in Laravel 4
Retrieving GET and POST data inside controller in the basic requirement which should know everyone when we are working in any framework. In Laravel 4.x It is very easy to get "Get & Post" data.
Examples:
The Example for Get data is
$...
Get all routes, Laravel 4
This is one of the important point which is not available on even stackoverflow. I want that by using one controller we at the moment which will handle every request that comes to my laravel 4.x application.This is one of the question which we sh...
Global filtering - how to use global scope in Laravel Eloquent
I have a situation which will help us to understand the use of Global Filtering.
Situation:
I have a published filter that I use for my articles. Guests can only view published articles, logged in users can view and apply filter (?published...
How to create multilingual translated routes in Laravel 4.x
Now there are n number of site which we have to make multilingual. In Laravel we have the facility to make
our site multilingual. In Laravel 4.x we will also make multilingual routes.There are few steps we have to follow to create multilingual t...
How to make controller,command using artisan in laravel 4.x
We can create controller and make command using artisan.The syntax for writing command for controller is:
Syntax for writing Controller:
php artisan controller:make ControllerName
Example for writing Controller:
php artisan control...
Insert a new record if not exist and update if exist, laravel eloquent
Laravel is very useful when we want to do basic operation .Suppose if we have a condition that we have to
Insert a new record if not exist and update if exist, If we do this task in php then we have to put if-else condition But In Laravel 4.x we...
Bulk Insertion in Laravel using eloquent ORM
Insertion is the very basic feature in every project. When we want to do bulk insertion there are n number of ways are available in Laravel to do bulk insertion. Some of the way to bulk insertion are:
1) By using Raw query in Laravel.
2) By ...
Automatically deleting related rows in Laravel (Eloquent ORM)
I am using Laravel and I want Automatically deleting rows using Eloquent ORM .In laravel we have deleting
event .By using this "deleting" event we can do all the clean up or what we want to delete we are able to delete.
By using example ...
Using namespaces in Laravel 4
Namespaces plays an important feature of php. Namespaces are used to solve 2 major issues.
1) Authors of libraries
2) Applications encounter
Laravel 4.x also provide namespace to solve those issues.
The files are app/controllers/F...
How to select from subquery using Laravel Query Builder?
Sub query is one the important section of database query.There are n number of situation where we want to implement sub query to fetch the data from the table. In Laravel 4.x there is no specific keyword to perform any
sub query.To perform sub q...
Setting up Laravel on a Mac php artisan migrate error: No such file or directory
I have all code in github and my project is running properly in Ubuntu system . I want to run and set up my Laravel project on a Mac and I am getting error "No such file or directory" when we write the command
php artisan migrate
...
Laravel 5.0 Including Sub View Into Another View
Many times we need some sections of HTML which need to be incorporated in many views and just to reduce redundancy we create separate views for it.
An example to accomplish that is stated below:-
Including other views in other view synt...
Laravel 5.0 Writing Static Query In Laravel
Many times we needs to write static query in Laravel. Some time due to the complexity of the query or sometime due to the MYSQL build in functions not supported in the Query Builder or in Eloquent in Laravel example LPAD. Thus at that time Larave...
Laravel 5.0 Relationship In Laravel And How To Use It
In laravel we can create relation between the tables and can use them where ever we need it we need not to create custom queries or use query builder to retrieve data. I have written one of example of my worked project.
//hasOne relationsh...
Laravel 5.0 Giving Alias in routing
In route in laravel we can create alias for a url. Laravel provide us the facility for giving alias for an url. We can use this url alias any where in our view
routes.php
Route::get("admin/department/{id}", ['as' => 'department.edit', 'u...
Laravel 5.0 Defining Different Named Fields as CREATED_AT And UPDATED_AT
In Laravel two fields are auto filled or modified they are created_at and updated_at but what if your table have different named fields example created and modified in it's place they won't be auto filled or modified automatically. So to make the...