Latest Laravel Post



How to get last executed query in Larave 5?

We have been many time need to get executed query log or you want to get last executed query or maybe if you want to diaplsy sql query from laravel query builder then you can do it that. so i have three example for display executed query in Laravel 5. when you are working on laravel application at that times , i think you need many time to print last run query or if you want to check direct from phpmyadmin sql box, so at that time you have to follow this three example. so, let's see three example of getting sql query from Laravel Query Builder. <strong class="step">Example 1:</strong> In this.....

By Hardik Savani | April 10, 2016 | | 16531 Viewer | Category : Laravel
READ MORE

How to get url segment in Laravel 5?

Whenever you need to get current url segment then you can get using Request facade. I give you example one for using Request facade. so you can get segment from url and how you can see both example. <strong>Example:</strong> <pre class="prettyprint lang-php"> @extends('layouts.app') @section('content') {{ Request::segment(1) }} @endsection </pre>

By Hardik Savani | April 10, 2016 | | 5842 Viewer | Category : Laravel
READ MORE

How to get current route name in Laravel 5?

Whenever you need to get current route name then you can get using Request or Route facade. I give you two example one for using Route facade and another for Request facade. so you can get route name both way and how you can see both example. <strong>Using Request:</strong> <pre class="prettyprint lang-php"> $routeName = Request::route()->getName()); print($routeName); </pre> <strong>Using Route:</strong> <pre class="prettyprint lang-php"> $routeName = Route::getCurrentRoute()->getPath(); print($routeName); </pre>

By Hardik Savani | April 10, 2016 | | 7440 Viewer | Category : Laravel
READ MORE

Laravel 5 Localization(trans helper) tutorial example

First Laravel 5 introduce localization for laravel application. Localization is very pretty intrsting topic added on laravel 5. Localization through we can manage multiple language message. i mean you can manage multiple languages within your application. for example you have one title like "Home Page", this is static title and now it is in english, but you also manage other language like if this site open in spanish then name will like : "Página de inicio". <img width="100%" src="/upload/Laravel-Localization-Tutorial.png" alt="Laravel-Localization-Tutorial.png" style="border:2px solid red".....

By Hardik Savani | April 9, 2016 | | 16633 Viewer | Category : Laravel
READ MORE

Laravel 5 - Class 'Input' not found issue?

When i start to work on Laravel 5.2 at that time i fetch this problem "Class 'Input' not found". When i copy my old controller code from laravel 5.1 version that time i found this issue, but i also could use Input insted to Request but i want to use Input as it is. But at last found solution. you have to just use following aliase on your controller. <pre> use Illuminate\Support\Facades\Input as Input </pre>

By Hardik Savani | April 8, 2016 | | 5073 Viewer | Category : Laravel
READ MORE

How to redirect route with querystring in Laravel 5?

Most of time, we work on back-end and we require to redirect route or url from controller with pass query string parameter. so laravel provide very simple way to pass query string parameter with redirect route. In following example you can see how it is possible. In Bellow example you can see i did added highchart() function for route haddle. in that function i redirect "home" route with 2 parameter as query string like id and itemid, so url will be like this way: <pre>http://test.hd/home?id=2&itemid=3</pre> And controller function will be this way: <strong class="example">Example:</strong> .....

By Hardik Savani | April 8, 2016 | | 13495 Viewer | Category : Laravel
READ MORE

Laravel 5 client side validation using Parsley.js example

In this post i want to show you to add client side js validation. Parsley is javascript library that provides lot's of validation for the form. this library you can also you with PHP, .net etc language. But in this post i did give you example with laravel 5 framework. Parsley.js is pretty interesting js library. Parsley.js through you can add required, Email, Number, Integer, Digits, Alphanum, Url, Minlength, Maxlength, Length, Min, Max, Range, Pattern, Check etc validation provide. you can also add custome validation message for this validation rules. you have to just give attribute of Pars.....

By Hardik Savani | April 7, 2016 | | 14722 Viewer | Category : Laravel
READ MORE

How to generate route with query string parameter in Laravel 5?

Whenever you require to add query string parameter in link url, i mean in route then you generate link with query string parameter using Laravel 5 URL facade. most of new developer doing this way: <pre class="prettyprint lang-html"><a href="{{ URL::route('home') }}.'?id=1&test_id=2'">Test</a></pre> But you should do it that this way, bellow example you can see how it done. <pre class="prettyprint lang-html"><a href="{{ URL::route('home',['id'=>'2','test_id'=>'3']) }}">Test</a></pre>

By Hardik Savani | April 7, 2016 | | 15346 Viewer | Category : Laravel
READ MORE

How to solve 'There are no commands defined in the "cashier" namespace' in Laravel 5

When i did start to learn "Laravel Cashier" and i was following step by step of laravel official document, but i run bellow command : <pre>php artisan cashier:table users</pre> At that time i found following error on my terminal: <pre>[Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the "cashier" namespace.</pre> I try to solve this error, i also clear all cache and add service provider, it means i try totally and i can't found solution for this error, but you can also add migration like this way if you want it is a same like we did bellow c.....

By Hardik Savani | April 6, 2016 | | 6177 Viewer | Category : Laravel
READ MORE

Laravel 5 generate sitemap using roumen/sitemap package Example

In this post i want to githubve example of generate dynamic sitemap using "roumen/sitemap" package. sitemap is very usefull for SEO. you can submit your sitemap on google webmaster, bing webmaster etc that way you can increase website rank and web traffic. So, if you are working on Laravel framework then you can use "roumen/sitemap". this package will helps to generate dynamic sitemap of website. so it's very simple way to use and pretty interesting package. you can also add image on sitemap. this package is also provide to generate sitemap and store it on you folder etc. you can also see the .....

By Hardik Savani | April 6, 2016 | | 12288 Viewer | Category : Laravel
READ MORE

    Jquery - How to copy text to clipboard without flash example ?

    Jquery - How to copy text to clipboard without flash example ?

    Open Post

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    Open Post

    Bootstrap - maxlength validation with count remaining character example

    Bootstrap - maxlength validation with count remaining character example

    Open Post

    How to change date format in jquery using moment JS ?

    How to change date format in jquery using moment JS ?

    Open Post

    Laravel 5 - How to create custom error page with example

    Laravel 5 - How to create custom error page with example

    Open Post

    Laravel 5 - GEO chart example and demo using lavacharts package

    Laravel 5 - GEO chart example and demo using lavacharts package

    Open Post