<commit_before><?php

namespace App\Console\Commands;

use App\Models\Migrations;
use Artisan;
use ConfigWriter;
use App\Models\Settings;
use Illuminate\Console\Command;

class Install extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'canvas:install';

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

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

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->comment(PHP_EOL.'Welcome to Canvas! You\'ll be up and running in no time...');
        $config = new ConfigWriter('blog');

        // Database Setup
        $migrations = Migrations::all()->first();
        if (empty($migrations)) {
            $this->comment(PHP_EOL.'Creating your database...');
            $exitCode = Artisan::call('migrate', [
                '--seed' => true,
            ]);
            $this->progress(5);
            $this->line(PHP_EOL.'<info>✔</info> Success! Your database is set up and configured.');
        }

        // Blog Title
        $blogTitle = $this->ask('Step 1: Title of your blog');
        $this->title($blogTitle);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog title has been saved.');

        // Blog Subtitle
        $blogSubtitle = $this->ask('Step 2: Subtitle of your blog');
        $this->subtitle($blogSubtitle);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog subtitle has been saved.');

        // Blog Description
        $blogDescription = $this->ask('Step 3: Description of your blog (Open Graph Meta Information)');
        $this->description($blogDescription);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog description has been saved.');

        // Blog SEO
        $blogSEO = $this->ask('Step 4: Blog SEO Keywords (minimal,blogging,platform)');
        $this->seo($blogSEO);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog SEO keywords have been saved.');

        // Blog Author
        $blogAuthor = $this->ask('Step 5: Author of your blog');<commit_msg>Fixes database conditional on installation<commit_after><?php

namespace App\Console\Commands;

use Artisan;
use ConfigWriter;
use App\Models\Settings;
use App\Models\Migrations;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Schema;

class Install extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'canvas:install';

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

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

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->comment(PHP_EOL.'Welcome to Canvas! You\'ll be up and running in no time...');
        $config = new ConfigWriter('blog');

        // Database Setup
        if (!Schema::hasTable('migrations'))
        {
            $this->comment(PHP_EOL.'Creating your database...');
            $exitCode = Artisan::call('migrate', [
                '--seed' => true,
            ]);
            $this->progress(5);
            $this->line(PHP_EOL.'<info>✔</info> Success! Your database is set up and configured.');
        }

        // Blog Title
        $blogTitle = $this->ask('Step 1: Title of your blog');
        $this->title($blogTitle);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog title has been saved.');

        // Blog Subtitle
        $blogSubtitle = $this->ask('Step 2: Subtitle of your blog');
        $this->subtitle($blogSubtitle);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog subtitle has been saved.');

        // Blog Description
        $blogDescription = $this->ask('Step 3: Description of your blog (Open Graph Meta Information)');
        $this->description($blogDescription);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog description has been saved.');

        // Blog SEO
        $blogSEO = $this->ask('Step 4: Blog SEO Keywords (minimal,blogging,platform)');
        $this->seo($blogSEO);
        $this->line(PHP_EOL.'<info>✔</info> Success! The blog SEO keywords have been saved.');

        // Blog Author
        $blogAuthor = $this->ask('Step 5: Author of your blog');
{'fraction_non_alphanumeric': 0.14483918435989068, 'fraction_numerical': 0.002522598276224511, 'mean_word_length': 2.3041666666666667, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4489939', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1380, 'n_words': 373}