Crysfel
Crysfel

Reputation: 8158

How to run artisan outside of Laravel?

Is it possible to run Artisan commands from a script that is not part of Laravel?

How can I import artisan into my script?

<?php

 Artisan::call('some:command');

This script will is not part of Laravel and just a regular old php file. My question is, how can I import Artisan into my script?

My final goal, is to automate the installation of my app, I need to run a migrations, seeds and a couple other things.

Upvotes: 4

Views: 3592

Answers (1)

Rob Fonseca
Rob Fonseca

Reputation: 3819

Unfortunately, you cannot use artisan without Laravel as it is not a stand-alone package and requires the full Laravel framework.

However, Artisan is based on the Symfony Console package which can be added to your script as a stand-alone package, which is the closest you will get to Artisan without writing a custom bash script.

http://symfony.com/doc/current/components/console.html

Upvotes: 4

Related Questions