Tag : helper


How to get keys name from array using array helper in PHP Laravel ?

Few days ago, I was working on my new Laravel 5.4 application and i require to get keys name from my array. i was thing how we can get it and laravel provide us for to do it. Finally i found array helper function in Laravel docs. There are several array helper function available for array. I found array_keys() helper for getting keys name from our array. array_keys() will return array of keys. It could be easy to work with keys name in array. So in this example i want to share with you small example using array_keys() helper. I created one route "myarraykeys" with my $myArray variable, and .....

By Hardik Savani | February 18, 2017 | | 536 Viewer | Category : PHP Laravel
READ MORE

Laravel 5 Redirect to URL using redirect() helper

In this tutorial, i am going to tell you how to redirect user one page to another page from controller method. we normally use <strong class="path">redirect()</strong> helper method for redirect user in controller. We can simply use redirect() helper in Laravel 5.0, Laravel 5.1, Laravel 5.2 and Laravel 5.3. Laravel 5 version provided redirect(). there are several way to do redirect URL in Laravel. In this post i am going to give you all the way to redirect URL with parameters. There are several methods through we can redirect URL in Laravel 5 as listed bellow: <strong>1) Redirect to URL</st.....

By Hardik Savani | October 19, 2016 | | 1393 Viewer | Category : Laravel
READ MORE

Codeigniter - How to get current url in controller or view ?

Sometimes, we need to get current URL path in your controller file or view file. So, we can get simply using "url" helper. Codeigniter provide url helper library that way we can get existing page url or base url etc. current_url() through we can get current url in your Codeigniter application. But, you should load "url" helper before use current_url(). you can load url helper as bellow: <pre> $this->load->helper('url'); </pre> In bellow example, you can see code how can i get current url in your controller file. So, let's see. <pre class="prettyprint lang-php"> $this->load->helper('url'); <b.....

By Hardik Savani | August 2, 2016 | | 773 Viewer | Category : Codeigniter
READ MORE

How to remove key from array in Laravel 5?

Sometimes, we require to delete specific key from array like we have password and confirm-password field but we don't require to store confirm-password field we have to drop that key from input array, At that time we always use unset() function of PHP pre-define. But if you work on laravel then you can array helper function. we can remove multiple key from variable using <strong class="path">array_except()</strong> of Laravel pre-define function. In bellow example you can understand very well. <strong>Example:</strong> <pre class="prettyprint lang-php"> $myArray = ['name'=>'HD','email'=>'te.....

By Hardik Savani | July 7, 2016 | | 1319 Viewer | Category : Laravel
READ MORE

How to generate slug using str_slug() helper in Laravel 5?

Generally we require to create slug when we are for front application in laravel, i mean like shopping website, social website because we should have good slug URL for post. So, Laravel provides several string helper like str_limit, str_plural, str_finish, str_singular etc and also str_slug(). str_slug() through we can make proper slug like remove space, remove special character etc. that way it also good for SEO friendly URL. you can see i give syntax and example of str_slug() helper. <strong>Syntax:</strong> <pre> str_slug(string); </pre> <strong>Example:</strong> <pre class="prettypri.....

By Hardik Savani | July 5, 2016 | | 1348 Viewer | Category : Laravel
READ MORE

How to generate random unique string in Laravel 5?

Laravel provide several string helper that way we can use it easily like str_limit, str_plural, str_finish, str_singular etc. If you need to generate unique random string then you can use str_random() helper of Laravel. It is very simple and you can use easily. str_random() helper take one numeric argument and return number of unique string that you pass as argument. you can see it's syntax and example: <strong>Syntax:</strong> <pre> str_random(number); </pre> <strong>Example:</strong> <pre class="prettyprint lang-php"> $random = str_random(30); </pre>

By Hardik Savani | June 29, 2016 | | 1316 Viewer | Category : Laravel
READ MORE

    How to create middleware for XSS protection in laravel 5?

    How to create middleware for XSS protection in laravel 5?

    Open Post

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Open Post

    Paypal payment gateway integration in php source code example

    Paypal payment gateway integration in php source code example

    Open Post

    Laravel 5 Stripe example using Laravel Cashier from Scratch

    Laravel 5 Stripe example using Laravel Cashier from Scratch

    Open Post

    PHP - multiple file uploading dropzone js example

    PHP - multiple file uploading dropzone js example

    Open Post

    Jquery Select2 - Select box with search example code

    Jquery Select2 - Select box with search example code

    Open Post