Support the ongoing development of →
Last updated 10 months ago.

The schema builder does not have the ability to create views so you have to write the sql necessary to create them manually in your migration classes.

Just create a migration like usual then delete everything in the up and down methods and replace it with the queries need to create and drop the view.

DB::statement('CREATE VIEW ...');
DB::statement('DROP VIEW ...');

Keep in mind this will only work if you are using mysql.

Last updated 10 months ago.

Thanks spekkionu......

Last updated 10 months ago.

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.