Category : Laravel



How to create custom helper in Laravel 5?

I would like to explain how to create custom helper functions, in your laravel project some functions and some repeating code, so at that time you have to create some helper functions that can help to easy way and every time you not need to write more code and very flexible, that way you can easily modify that code. Now if you want to add custom helper functions in your website or project directoty then you have to follow just three step and use it. <strong>Step 1: Create helpers.php File</strong> In this step, you need to create <strong style="color:red">app/Http/helpers.php</strong> in you.....

By Hardik Savani | February 9, 2016 | | 18091 Viewer | Category : Laravel
READ MORE

How to get product using rakuten marketing api in PHP?

In this post you can find how can use rakuten linkshare API in our php website. first you need to create class for retrieve data from "https://pubhelp.rakutenmarketing.com/hc/en-us" website. now i give to example of product search, but if you use this class then you can easy to implement your other search like advance search etc. So now i am giving you class that send request to rakutenmarketing.com website and get data. but this class you can also you for other site API use like CJ API. <strong>Your php file :</strong> <pre class="language-php"> public function getProduct() { // Bearer to.....

By Hardik Savani | February 6, 2016 | | 9999 Viewer | Category : Laravel
READ MORE

Example of Cron Job in Laravel 5

Whenever you want to define your scheduler task, and if you are working on laravel framework then you can do it easy way and very secure. Laravel provide <strong>Scheduling</strong> and Scheduling through you can manage your cron, if you need to run every day, every minute, every hourly, weekly, on specified days.So, basically i going to give example how to create cronjobs in laravel. First you have to create one command that way you can create proper programming and good way, but you can also do without create command, It is good if you create your own command and with good code. So, open yo.....

By Hardik Savani | February 6, 2016 | | 43356 Viewer | Category : Laravel
READ MORE

How to get months difference between two dates in laravel?

Whenever you need to get difference between two dates in months in laravel 5 then you can get easily using Carbon. Laravel by default provide Carbon class. Carbon class throught you can calculate difference between two dates in months. In Following example you can see, we have a two dates, first $to variable and second one $from variable. Carbon class diffInMonths function using you can get difference between two dates. I hope you will find your solution. <strong>Example:</strong> <pre class="language-php"> $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34'); $from = \C.....

By Hardik Savani | February 6, 2016 | | 6164 Viewer | Category : Laravel
READ MORE

How to get last inserted id in laravel 5?

Its very common need to get last insert id in programming field, if you are working on laravel framework and you want to fetch last created id, i mean max id, then you do easily.laravel provide method to get last inserted id. If you are working with DB::table() then you have to use insertGetId() for insert data into database. this function always return inserted record id(primary key).it is very simple way to get id, in following example you can see and undestand more: <strong>Example:</strong> <pre class="language-php"> public function getLastInsertedIdDB() { $id = DB::table('items')->inser.....

By Hardik Savani | February 6, 2016 | | 36335 Viewer | Category : Laravel
READ MORE

How to increment or decrement a column value in laravel?

Whenever you need to increment or decrement value of column in database, then you do not need to first fetch that record and then update, so that way we will make long code and very hard code, so basically you can increment and decrement by using increment() and decrement() statment of laravel query builder. If you want to increment or decrement opration using update() method of laravel query builder then you also do that, in following example i am showing you how to increment and decrement value of column in table by using increment(), decrement() and update(). <pre class="language-php"> na.....

By Hardik Savani | February 2, 2016 | | 17961 Viewer | Category : Laravel
READ MORE

How to add text on image in laravel 5?

if you are use laravel and you want to add text on image or resize, crop image then we can do with "intervention/image" pakacke. you have to just follow few step and you can add text on image. <strong>Step 1 : </strong>you have to add package on your laravel project by using composer like : <pre>composer require intervention/image</pre> <strong>Step 2 :</strong> then you have to add provider path and alias path in config/app.php file like : In $provides : <pre>'Intervention\Image\ImageServiceProvider'</pre> In $aliases : <pre>'Image' => 'Intervention\Image\Facades\Image'</pre> [ADDCODE].....

By Hardik Savani | January 30, 2016 | | 15581 Viewer | Category : Laravel
READ MORE

How to get days difference between two dates in laravel?

Whenever you need to get difference between two dates in date in laravel 5 then you can get easily using Carbon. Laravel by default provide Carbon class. Carbon class throught you can calculate difference between two dates in days. In Following example you can see, we have a two dates, first $to variable and second one $from variable. Carbon class diffInDays function using you can get difference between two dates. I hope you will find your solution. <strong>Example:</strong> <pre class="language-php"> $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34'); $from = \Carbon\.....

By Hardik Savani | January 29, 2016 | | 12952 Viewer | Category : Laravel
READ MORE

HTML/FORM not found in Laravel 5?

If you want to use Form or Html class and when you will see error like ‘HTML’ class not found OR ‘Form’ class not found. don’t worry about that because Laravel 5 change the package. you should download the HTML and FORM class helper from given instruction above. Add given bellow text to your composer.json file. <pre>"require": { "laravel/framework": "5.0.*", "laravelcollective/html": "~5.0" },</pre> <strong>OR</strong> <pre>composer require laravelcollective/html</pre> after fire composer update command After Update composer, open config/app.php and add this line to the ‘providers.....

By Hardik Savani | January 27, 2016 | | 34924 Viewer | Category : Laravel
READ MORE

PHP Laravel – How to solve “You need to specify a file path to store the seed laravel ” ?

when you install laravel and get the records from database then occur “You need to specify a file path to store the seed laravel” error. that error happened because your php can not loading openssl extension. so, If you are using windows then you should enable openssl extension in following path : <pre> Path : C:\wamp\bin\apache\Apache2.4.4\bin </pre> Find: <pre> ;extension=php_openssl.dll INTO extension=php_openssl.dll </pre> Try this..........

By Hardik Savani | January 25, 2016 | | 1209 Viewer | Category : Laravel
READ MORE

    How to integrate google map using gmaps.js in php example?

    How to integrate google map using gmaps.js in php example?

    Open Post

    Laravel 5 Localization(trans helper) tutorial example

    Laravel 5 Localization(trans helper) tutorial example

    Open Post

    How to get location information from ip address in Laravel ?

    How to get location information from ip address in Laravel ?

    Open Post

    PHP - File upload progress bar with percentage using form jquery example

    PHP - File upload progress bar with percentage using form jquery example

    Open Post

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Open Post

    AngularJS - convert comma separated string to array example

    AngularJS - convert comma separated string to array example

    Open Post