Tagged: Laravel


Complex unique validation rule in Laravel

Laravel provides unique validation rule for check unique value on a given database table. Ref : https://laravel.com/docs/5.1/validation#rule-unique Syntax unique:table,column,except,idColumn,whereColumn1,whereValue1,whereColumn2,whereValue2,… Ex1. Validate unique value in given database table

Ex2. Validate unique value except given...


Use –create option when create migration

To create migration, we can use this artisan command.

Laravel will create a new migration file in database/migrations directory. Generated file is like this:

up() method is used to create a new...


How to update timestamp in pivot table in Laravel

When insert a new row to pivot table, we can use attach() method like this:

But this will not update created_at and updated_at timestamps column in pivot table. To update timestamps, use withTimestamps()...


Troubleshooting after update to Homestead 0.5.0

Error 1 Maximum call stack size exceeded error Solution Update npm using sudo npm i npm -g command. Error 2 ENOENT: no such file or directory, scandir ‘/home/vagrant/app-name/node_modules/node-sass/vendor’ error Solution Execute npm rebuild node-sass...


Some Tips when using Entrust in Laravel

I got the problem when using bican/roles Role module in my Laravel project. There is an error when I check permission. So I decided to move zizaco/entrust and tested all features working normal. How...


Class memcached not found error in Laravel

If you got bellow error when use memcached in Laravel, please check following steps.

Install memcached

Enabled php5-memcached

Restart apache web server

Check memcached service status

Clear cache...


How to disable xdebug

When I run composer update command in shell, composer displays warning like bellow.

And takes too long time to process. I already go to https://getcomposer.org/xdebug reference and tried to disable xdebug option in...


Deploy Laravel to Production

Clone laravel source to server

Install necessary modules

Make .env

Generate key to .env

Execute gulp if necessary

Migrate database

Give owner to web server

Set write...


How to setting to use SQL Server in Laravel

When I setup Laravel project for my company, I’ve faced the problem about SQL Server database connection problem. I’ve googled and now I can use it. 1. Install php7.0-sybase to Homestead New version of...