App\Http\Controllers\AppController::install PHP Method

install() public method

public install ( )
    public function install()
    {
        if (!Utils::isNinjaProd() && !Utils::isDatabaseSetup()) {
            try {
                set_time_limit(60 * 5);
                // shouldn't take this long but just in case
                Artisan::call('migrate', ['--force' => true]);
                if (Industry::count() == 0) {
                    Artisan::call('db:seed', ['--force' => true]);
                }
                Artisan::call('optimize', ['--force' => true]);
            } catch (Exception $e) {
                Utils::logError($e);
                return Response::make($e->getMessage(), 500);
            }
        }
        return Redirect::to('/');
    }