Category : Laravel

how to generate random passwords in laravel

this snippet will teach you how to generate random passwords in laravel through laravel helper functions

Laravel eloquent multiple WHERE with multiple OR AND

this snippet will provide you code examples of how to use multiple where conditions with multiple or conditions or and conditions

Force https on laravel application

If you have purchased a SSl certificate for your website and then you website is still serving the assets from an HTTP protocol instead of https, and also the form and redirects are going to http instead of https, then here is the way to fix this from within laravel AppServiceProvide.

export data to pdf in laravel using domPDF package

this snippet will help you to get started with domPDF package for laravel to export your data in pdf format

set from email dynamically when sending mails in laravel

this snippet will teach you how to set different FROM EMAIL which exists in database to use as sender email when sending emails in laravel

Laravel pagination problem when deleting last item

when deleting the last record on pagination page , this will make that page be fully empty with no records ... this snippet will allow you to redirect to the main route when deleting the last record on pagination and the page is empty

Eloquent normal sql select statement

In laravel and eloquent, some times you might need to run a normal SQL select statement. So here is an example to do so:

make controller artisan command with parameters

This command creates a new controller file in app/Http/Controllers folder in laravel with all available parameters

Composer update error

If you installed the new composer on php version 7.1, this will show an error like this : Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in /var/www/vhosts/example.com/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php on line 11 Here is a solution to this issue

Laravel eloquent, query based on where AND OR inside it

Some times you will need to create an eloquent where clause and inside that where you may need to add extra or where claused