X

Create New Item

File Folder

X

Search Results

File "AskToRunMigrations.php"

Full path: /home/orbitecv/orbite-school.orbit.et/vendor/spatie/laravel-package-tools/src/Commands/Concerns/AskToRunMigrations.php
File size: 601 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?php

namespace Spatie\LaravelPackageTools\Commands\Concerns;

trait AskToRunMigrations
{
    protected bool $askToRunMigrations = false;

    public function askToRunMigrations(): self
    {
        $this->askToRunMigrations = true;

        return $this;
    }

    protected function processAskToRunMigrations(): self
    {
        if ($this->askToRunMigrations) {
            if ($this->confirm('Would you like to run the migrations now?')) {
                $this->comment('Running migrations...');

                $this->call('migrate');
            }
        }

        return $this;
    }
}