Given the following code: I want to get the raw SQL query string that the database query builder above will generate. In this example, it would be SELECT * FROM users. How do I do this? Answer To output to the screen the last queries ran you can use this: I believe the most recent queries will be at the
Tag: laravel
Make column not nullable in a Laravel migration
I’m writing a migration to make certain columns in a table nullable right now. For the down function, I of course want to make those columns not nullable again. I looked through the schema builder docs, but couldn’t see a way to do this. Any help would be appreciated. Answer Prior to Laravel 5, there was no Laravel native way