Category : Laravel



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 | | 8368 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 | | 10505 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 | | 20434 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 | | 5800 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 | | 18255 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 | | 18355 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 | | 18773 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 | | 7196 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 | | 14618 Viewer | Category : Laravel
READ MORE

How to get user agent value in Laravel 5?

If you are work on laravel 5 application and you require to get user agent(user agent mean user browser details like firefox, cherome etc) then you can get easy. you don't need to use $_SERVER variable like native PHP, but laravel 5 provide Request facade. you can fetch easy using following example: <strong class="example">Example</strong> <pre class="prettyprint lang-php"> public function ImpressionCount(Request $request) { $impre['useragent'] = $request->server('HTTP_USER_AGENT'); $input['ip'] = $request->ip(); print($input); } </pre>

By Hardik Savani | April 5, 2016 | | 10595 Viewer | Category : Laravel
READ MORE

    PHP - Behance API tutorial with example and demo

    PHP - Behance API tutorial with example and demo

    Open Post

    Laravel 5 - How to convert file(image, audio, video) extension using CloudConvert?

    Laravel 5 - How to convert file(image, audio, video) extension using CloudConvert?

    Open Post

    How to create REST API in Laravel 5 ?

    How to create REST API in Laravel 5 ?

    Open Post

    Laravel 5 - Confirmation before delete record from database example

    Laravel 5 - Confirmation before delete record from database 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

    PHP - Dynamically Add Remove input fields using JQuery Ajax Example with Demo

    PHP - Dynamically Add Remove input fields using JQuery Ajax Example with Demo

    Open Post