<?php

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class DemoInstallCommand extends Command {

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'demo:install';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Install demo.';

	/**
	 * Create a new command instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function fire()
	{
		try
		{
			$this->call('migrate:install', ['--force' => true]);
		}
		catch (Exception $e) {

		}

		$this->call('migrate:reset', ['--force' => true]);
		$this->call('migrate', ['--package' => 'cartalyst/sentinel', '--seed' => true, '--force' => true]);
		$this->call('migrate', ['--force' => true]);

		if (file_exists($path = $this->laravel['path.storage'].'/logs/laravel.log'))
		{
			@unlink($path);
		}
	}

	/**
	 * Get the console command arguments.
	 *
	 * @return array
	 */
	protected function getArguments()
	{
		return array(

		);
	}

	/**
	 * Get the console command options.
	 *
	 * @return array
	 */
	protected function getOptions()
	{
		return array(

		);
	}

}
