Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

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...

How to get Directory size using PHP

Hello Reader's!, If you are looking for a code that can give the directory size from a given path, Then you can use below library code for both Windows and Linux hosting:- If on a Windows Host: <? $filePath = 'c:/www/myfolder'; ...

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...

Localization in Laravel 5.x

In Laravel 5.x we have lang class which will help us to retrieving string in different languages that will help us to easily support multiple languages. The folder structure for /resources/lang files are /resources /lang /en ...

What is the difference between '|' and '||' operators

Hello Reader's you might have seen the coding standard with the common syntax | and || is used. These are the syntax used for checking the conditions and sub conditions. The first | is called as bit wise Operator. It is used to make the conditio...

Laravel 4.x Carbon Class

The Carbon class is inherited from the PHP DateTime class. Example: <?php class Carbon extends \DateTime { // code here } ?> There are n number of situation when we want to get the 1 day or 2 days old data. For this we w...

PHP :- Scraping Data From Youtube Video URL

You can also get the data i.e title, description, thumbnail_url, etc from the Youtube video url by using following script. Remember you need to put the YOUR_GOOGLE_DEVELOPMENT_KEY which you can generate by creating account in Google Developer Con...

How to enable Socket Transport SSL in PHP

Hello reader's If are using the Windows environment and developing the SSL based websites then you might have to enable the SSL for PHP for the first time. So to enable that you just need to perform the following tasks steps:- Step1: Renam...

How to get variable with same name in POST using PHP

Hello Reader's if have a html form with the variable of same name then you can get them indevisaly by POST Change the names of your inputs: <input name="name[]" value="Address" /> <input name="name[]" value="Number" /> <in...

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...

How to sort an given array by it's any key index

Hello Reader's! if you have an given array on with you want to sort with any selected key index as show below:- Array ( [0] => Array ( [configuration_id] => 10 ...

How to extract website tittle using the given URL

Hello Reader's! If you having a set of given url's you need just the title of them, then you can use the PHP code below to extract title <?php function TitleURL($YourURL){ $str = file_get_contents($YourURL); if(strlen($str)>0)...

Migration in laravel 4.x

Migrations has very important role in Laravel 4.x. By using Migrations we can create and update our database and by using Migration we can save time because it will create schema by using single command. Migrations Creation: In Laravel 4.x M...

How to destroy user session automatically in PHP if he don't log out

Hello Reader's! If you have to destroy or unset the user's session automatic then the better way is to set with time dependency session_start(); if (!isset($_SESSION['EXPIRES']) || $_SESSION['EXPIRES'] < time()+1800) { session_destr...

How to integrate google reCAPTCHA in your html form?

To integrate reCAPTCHA in your HTML form, you need a public & secret key. You can get the both keys from this URL https://www.google.com/recaptcha/admin and it will look like Public Key: 9Madr_cSZZADgLy9zeFTEraGn9ogHhxuh_6pquJUHYyt ...

Queue in laravel 5.x

Laravel Queue is one of the best feather of Laravel 5.x. When we want to make our site fast and we have to fetch and store large amount of data then we will run our query on back end. In Laravel 5.x by using queue we can run time consuming on bac...

Creating Your First Module

Creating module is easy in drupal Steps you need to follows are as below. Creating the module directory Creating the .info file Creating the .module file Where does your custom module goes? Its always better to keep contrib and cu...

Pagination in Laravel 5.x

It is very painful to use pagination in other framework but In Laravel 5.x it is very easy to implement pagination. By using paginate method on the query builder we will takes care of setting the proper limit and offset based on the current page ...

Routing in Laravel 5.x

In any project routing plays an important role.In Laravel 4.x we will define our routes in routes.php which is in app/Http/routes.php which is loaded by the App\Providers\RouteServiceProvider class. In Laravel 5.x the basic routes consist of a UR...

Laravel 5.0 Creating Download CSV Link

In Laravel, many times we may need to create a link to download sample CSV file. So that user can download sample CSV file from our website and upload correct formatted file. It's a very simple task and to accomplish that we need to follow fo...

URLs in laravel 4.x

There are n number of functions of URLs in laravel 4.x which is used to perform action that are action: action is a function which is used to generate a URL for a given controller action. Example: $url = action('HomeController@getInde...

Laravel 5.0 Creating Custom Middleware For Different Roles

Laravel provide us the facility to create our custom middleware for user's authentication. We can create different MIddleware for different roles. To accomplish it we need to follow the following steps. Step 1st:- Creating new Middleware for...

Strings in laravel 4.x

There are n number of functions of strings in laravel 4.x which is used to perform action in string that are camel_case: camel_case is a function which is used to convert the given string to camelCase. Example: $camel = camel_case('fo...

Laravel 5.0 Grouping Similar Routing Requets Requests

In Laravel many times we need to group together many routing requests having same middleware, controller, suffix, etc. We can achieve that by using Route::group. The syntax of it is stated below. Syntax :- Route::group(["middleware" =&g...

Laravel 5.0 Creating Request Handler

In Lavarel one of the best practice is to use form validation rules to validate the submitted data. There are number of ways to do it . One way is to create form validation rules both in the controller or we can create a separate file under the a...

Paths in laravel 4.x

There are n number of functions in laravel 4.x which is used to define path that are app_path: app_path is a function which is used to get the fully qualified path of the app directory. Example: $path = app_path(); base_path: ...

array_add,array_divide,array_sort Function in laravel 4.x

array_add : array_add function is used to add a key/value pair to the array.It will add only when there is no such key available in the existing array Example: $array = array('foo' => 'bar'); $array = array_add($array, 'key', 'val...

Best AJAX path for Wordpress

Hello Reader's if you want to write a custom code for making AJAX hit then you should choose for the best path for that, Open the file admin-ajax.php All ajax request should be made there. On in first step open the template file and write the ...

Laravel 5.0 Getting Old Values In the form

Many times we need to show our old values in a form after an error or validation stops our form from submitting. Laravel has a very nice way of retaining old values and populating it back into our form. I myself used it in a drop down, where ...

Laravel 4.x Localization

In laravel 4.x we have lang class which will help us to retrieving string in different languages that will help us to easily support multiple languages. The folder structure for lang files are /app /lang /en messa...

How to use in_array in php to find value in a array list?

You can take reference form below example to find the value in an array list using php in_array. Suppose you have a list of Favorite List items (for example a list of colors names) and you want search your color is exist in list or not exist. ...

in_array and array_key_exists in php

Hello Readers In php there is a great role of php array, we will discuss about the in_array and array_key_exists in php with examples. in_array in php: in_array: in_array in php checks the array value it is exist or not to the given arr...

Google Charts with Jquery Ajax

If you are working on a Google chart and need some jquery ajax requirement, then this blog is quite useful. I found this very powerful and simple to implement. Find the link at the end of details: Google Charts with Jquery Ajax If you are w...

Custom Audio Player with Jquery Audio Controls Plugin

If you are working on audio player and got stuck to manage audio controls and this jquery plugin is very useful. Find the link at the end of following details to use this plugin: Custom Audio Player with Jquery Audio Controls Plugin Introdu...

Payment System with BrainTree PayPal using PHP

BrainTree is a very secure and easy to setup payment gateway. There are lots of features available in new Braintree and I found it very useful. Visit the link at the end of details: Payment System with BrainTree PayPal using PHP Are you wor...

Laravel Libraries

The best programming to do a code is "To make common function". So that we can use that function again and again. For this laravel provide Libraries. We can make a file in libraries folder and define our common function in that library and use th...

How to get current web page url in Laravel 4.x

To get the current page url in laravel 4.x is as follow $webpageURL=URL::to('/'); By using the above code it will automatically take the web page url. Example: Lets take a example of findnerd. **http://findnerd.com/acco...

Laravel Errors & Logging

Error logging handler is defined or registered in the app/start/global.php. We will define or configure logger to use a single log. In laravel we have MONOLOGY logging library. By using Monolog offers we will use n number of handlers. Example ...

Import Data from CSV file in Mysql Database

Hello friends, I am sharing that how we can save csv file data in mysql database. Csv Data consists of rows and columns with comma separated. for example we have a csv file which contains user first name, last name, age and designation. li...

Polymorphism in php

Hello Readers If we break the word Polymorphism poly means many (Poly = many) and morph means change ( Morph = change or form). Its basically the concept of object oriented programming (OOPS) in which classes have differernt functionality ...

Insert and Remove value from begining of an array

This article demonstrate two predefined functions of PHP to add and remove values from begining of an array. 1.array_shift(): This function removes first element of an array and returns the removed value. The numeric keys of array are automat...

How to Import CSV File Data into Mysql

Hi,   In my previous post I have explained about How to Export MySQL table data to CSV File using PHP. Now in this tutorial I am going to explain how to import CSV data file into mysql. Suppose that we have a CSV file with 3-4 entry,...

How to Add SEO Meta Tags in Wordpress without Plugins

Hello Guys, There are number of click plugins available on internet for your seo needs but most of them have many complex function for simple needs. I am not saying that there is no good SEO plugins in the market but they are few like All ...

How to get the max value from given multidimensional array using PHP?

Hello Reader! If you having an multidiamensnal array and you want to get the max value from a single element key then you see the example below:- [0] => stdClass Object ( [id] => TRF1254 [cust] => CUST9897 ...

How to Export MySQL table data to CSV File using PHP

In this blog I am going toexplain how to export mysql data to CSV file using php. CSV stand for comma separated values. Using the below code you can easily download CSV file and use anywhere. <?php function exportMysqlToCsv($table,$...

How to Authenticate user in PHP using PDO

Hi friends, If you are using PDO in php , Now you can Authenticate user using simple code. include 'conn.php'; try { $username = $_POST['user']; $password = $_POST['pass']; $smt=$conn->prepare("SELECT * FROM signup WHER...

How to detect UTF encoding using PHP

Hello Readers! if you want to find out the type of file encoding using php then the code below will help you:- //check string strict for encoding out of list of supported encodings $enc = mb_detect_encoding($str, mb_list_encodings(), tr...

How to get color of image for the background using PHP

Hello Readers! If you are developing the dynamic website in which the image color will be the background color then you can see it doing in PHP :- <?php $filename = $_GET['filename']; $image = imagecreatefromjpeg($filenam...

How to make text url to hyperlink using PHP

Hello Reader!, On printing the url in plain text, they do not appears as hyper linked but using PHP you can perform this. Let's see the example below that takes a plan url as input and return the hyperlinked url:- <? function createHyper...

Difference in using session_unset() and session_destroy() in PHP

For just the functioning part both the syntax will work the same but by writing session_unset will clears the $_SESSION variable but will not destroy the variables and it will initialize to this stage:- $_SESSION = array(); session_destro...
1 32 44
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: