How to set foreign key checks to zero in laravel 5?
Set Foreign Key Checks
While running migrations or seeding or importing data by running scripts, we might need to set foreign key checks to zero in database during these processes in laravel 5 programming. We can do this by following statements.
use Illuminate\Support\Facades\DB; DB::statement('SET FOREIGN_KEY_CHECKS=0'); /// functionality… DB::statement('SET FOREIGN_KEY_CHECKS=1');
Want to get PHP Application Development Service, then hire me at OutsourceUrDesign