Pregunta

I have been working with Laravel 3 on my local server. I have been using terminal and Artisan to perform my migrations.

I want to install my site on my production server, but I want to create a sort of 'install/migration' script that will perform all the migrations and guide a user through configuration.

I have found where all migration methods are (used by artisan) but I'm struggling to use them. Anyone know how?

¿Fue útil?

Solución

I think you are confusing some things (I'm not sure, so I'll tell just in case).

Migrations are meant for developers. Your end users don't run migrations directly. So migrations are for you and your fellow developers. If you want your users to run migrations, than you just create a normal page and have some link or a button that the user presses and this will run an action (a function) on your controller (if you have routes set up this way). In this function, you should run the migration.

Running migrations from PHP: you can use the Command class to run tasks.

Command::run(array('migrate'));

This will run the migrate task, obviously. Is this what you're after?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top