Category : Laravel


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 | | 937 Viewer | Category : Laravel
READ MORE

How to use groupby having with DB::raw in Laravel Query Builder?

We most probably require to use group by having because if you work on small project then it's not need to use generally. But if you work with big project like e-commerce, social or ERP level project then you may require to use having clause. having clause, we can use simply if we have to compare with number or static value like as bellow: <pre> ->having("total_quantity","<",10) </pre> But we need to compare with 10 instead of column name then it can't directly use column name. At that time we should use DB::raw() with column name. In this example i want to show minimum quantity items, I .....

By Hardik Savani | July 6, 2016 | | 1025 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 | | 1031 Viewer | Category : Laravel
READ MORE

Laravel 5.2 - User ACL Roles and Permissions with Middleware using entrust from Scratch Tutorial

Laravel 5 provides authentication to us but that it simple to get user register, login, logout, and reset password and run quickly and easily. Laravel 5 give you simple authentication and it's fast and it's consider to all developer requirement. But if you are work on big ERP or Project then you need to control access to certain sections of the website. I mean you require to role permissions based access control database design that way you can specify level of user. Roles and Permissions through you can create several types of users with different role and permission, i mean some user ha.....

By Hardik Savani | July 4, 2016 | | 47199 Viewer | Category : Laravel
READ MORE

How to solve - This cache store does not support tagging?

When i was working on ACL module for my project, i fetch error like : This cache store does not support tagging, if you use zizaco/entrust package for ACL and you fetch this error then you have to set array as cache driver, so open .evn file and change CACHE_DRIVER value this way: <strong>.env</strong> <pre class="prettyprint lang-php"> CACHE_DRIVER=array </pre>

By Hardik Savani | July 3, 2016 | | 4964 Viewer | Category : Laravel
READ MORE

Laravel - How to remove foreign key constraint using migration?

Sometimes it can be agreeable to remove a database column that hosts a foreign key relationship, and we add wrong column with foreign key constraint on table, At that time we must remove that column from table. But we can't remove directly using dropColumn() because we did apply foreign key constraint so we should drop foreign key constraint of that column using dropForeign() and then we can delete column using dropColumn(). You can see as bellw migration, first i added migration with wrong column then other migration for remove that column. <strong>Wrong Column Migration:</strong> <pre cla.....

By Hardik Savani | July 1, 2016 | | 915 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 | | 1008 Viewer | Category : Laravel
READ MORE

How to implement Email Verification with Activation Code example from Scratch in Laravel 5.2 ?

Email verification is a very basic step in the registration process of many applications. If have implemented email configuration in your project then you get lots of benefit like you can forgot password function properly, if user will add wrong content or any Spam in your site then you can contact easily. If you want to also implement email verify after user registration then you can simply implement in your laravel application. you just follow few step and get email Verification with Activation Code in your project. In this example you can add from scratch, so if you haven't work with larav.....

By Hardik Savani | June 28, 2016 | | 6467 Viewer | Category : Laravel
READ MORE

How can i get the path from laravel application root?

Laravel provide several helper to get path of public directory, app directory, storage directory and base directory. It will help to store files, read file from path and also for other from controller, view files, model etc. You can see as bellow how to get path of that directory using helper one by one. <br/> <strong>How to get public folder path in laravel ?</strong> <pre class="prettyprint lang-php"> public_path(); // Path of public/ </pre> <br/> <strong>How to get base path(Project Root) in laravel ?</strong> <pre class="prettyprint lang-php"> base_path(); // Path of application root </p.....

By Hardik Savani | June 27, 2016 | | 1194 Viewer | Category : Laravel
READ MORE

Laravel 5 - elasticsearch with pagination example

If you haven't install elasticsearch and you don't know how to install elasticsearch in laravel then you have to see first bellow link, in this link you can set up elasticsearch from scratch like install package, use with laravel model etc. : <a href="http://itsolutionstuff.com/post/how-to-use-elasticsearch-from-scratch-in-laravel-5example.html" target="_blank"><strong>How to use elasticsearch from scratch in laravel 5?</strong></a>. After finish step of above link, we can make elasticsearch with pagination view using laravel pagination eloquent. after impletement this example we could find l.....

By Hardik Savani | June 25, 2016 | | 2634 Viewer | Category : Laravel
READ MORE

    Laravel 5 - Barcode generator example using milon/barcode package

    Laravel 5 - Barcode generator example using milon/barcode package

    Open Post

    How to create middleware for XSS protection in laravel 5?

    How to create middleware for XSS protection in laravel 5?

    Open Post

    Laravel 5 custom pagination view example

    Laravel 5 custom pagination view example

    Open Post

    Laravel 5 dropbox api file upload example using league/flysystem-dropbox package

    Laravel 5 dropbox api file upload example using league/flysystem-dropbox package

    Open Post

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Open Post

    Solved - opencart this merchant is not enabled for auth/settle

    Solved - opencart this merchant is not enabled for auth/settle

    Open Post