Tag : Facade


How to get current url with parameters in Laravel 5?

We sometimes require to get full url path with query string parameters that way we can perform on it. So we can get current url with also all parameter using several method of laravel. There are several option to get full url with query string as listed bellow: <ul> <li><strong>URL Facade</strong></li> <li><strong>Request Facade</strong></li> <li><strong>$request Object</strong></li> </ul> I give you three way to get full path with parameters, so you can see as bellow: <strong>Example 1:</strong> <pre class="prettyprint lang-php"> public function index() { $fullURL = \URL::full(); p.....

By Hardik Savani | August 8, 2016 | | 868 Viewer | Category : Laravel
READ MORE

How to get file size from URL in Laravel 5?

We sometimes require to get file size from path in laravel, so if you need to get file size from url then no worry and you can get using File facade. File facade provide several function that way we can get size of file or image. In bellow example i just give you path of my images folder inside public folder and one image, that give path as argument of size function: <strong>Example:</strong> <pre class="prettyprint lang-php"> {{ File::size(public_path('images/1461177230.jpg')) }} </pre>

By Hardik Savani | July 18, 2016 | | 852 Viewer | Category : Laravel
READ MORE

How to check if file exists or not in Laravel 5?

Nowdays laravel framework is popular framework in PHP Language. So, if you required to check if file is exists or not in given path then you can check eisily. Normally we always need to check if image exists, check if pdf file exists, check if docs exists or not etc. I give you two way to check file is Exists or not. one using file_exists() and second one using File facade of laravel 5. it's better if you preffer File facade example. So, let's see and implement: <strong>Example 1:</strong> <pre class="prettyprint lang-php"> if(file_exists(public_path('images/1461177230.jpg'))){ dd('File i.....

By Hardik Savani | April 23, 2016 | | 1768 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 | | 1768 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 | | 1786 Viewer | Category : Laravel
READ MORE

    Crop, Resize, Frames etc on selected image in php using Aviary

    Crop, Resize, Frames etc on selected image in php using Aviary

    Open Post

    PHP - import excel file into mysql database tutorial

    PHP - import excel file into mysql database tutorial

    Open Post

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

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

    Open Post

    How to implement lazy loading image with example for your website?

    How to implement lazy loading image with example for your website?

    Open Post

    Laravel 5.3 - How to create SEO friendly sluggable URL

    Laravel 5.3 - How to create SEO friendly sluggable URL

    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