REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 4.46 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Text
Base64
<?php namespace Illuminate\Database\Console\Migrations; use Illuminate\Contracts\Console\PromptsForMissingInput; use Illuminate\Database\Migrations\MigrationCreator; use Illuminate\Support\Composer; use Illuminate\Support\Str; use Symfony\Component\Console\Attribute\AsCommand; #[AsCommand(name: 'make:migration')] class MigrateMakeCommand extends BaseCommand implements PromptsForMissingInput { /** * The console command signature. * * @var string */ protected $signature = 'make:migration {name : The name of the migration} {--create= : The table to be created} {--table= : The table to migrate} {--path= : The location where the migration file should be created} {--realpath : Indicate any provided migration file paths are pre-resolved absolute paths} {--fullpath : Output the full path of the migration (Deprecated)}'; /** * The console command description. * * @var string */ protected $description = 'Create a new migration file'; /** * The migration creator instance. * * @var \Illuminate\Database\Migrations\MigrationCreator */ protected $creator; /** * The Composer instance. * * @var \Illuminate\Support\Composer * * @deprecated Will be removed in a future Laravel version. */ protected $composer; /** * Create a new migration install command instance. * * @param \Illuminate\Database\Migrations\MigrationCreator $creator * @param \Illuminate\Support\Composer $composer * @return void */ public function __construct(MigrationCreator $creator, Composer $composer) { parent::__construct(); $this->creator = $creator; $this->composer = $composer; } /** * Execute the console command. * * @return void */ public function handle() { // It's possible for the developer to specify the tables to modify in this // schema operation. The developer may also specify if this table needs // to be freshly created so we can create the appropriate migrations. $name = Str::snake(trim($this->input->getArgument('name'))); $table = $this->input->getOption('table'); $create = $this->input->getOption('create') ?: false; // If no table was given as an option but a create option is given then we // will use the "create" option as the table name. This allows the devs // to pass a table name into this option as a short-cut for creating. if (! $table && is_string($create)) { $table = $create; $create = true; } // Next, we will attempt to guess the table name if this the migration has // "create" in the name. This will allow us to provide a convenient way // of creating migrations that create new tables for the application. if (! $table) { [$table, $create] = TableGuesser::guess($name); } // Now we are ready to write the migration out to disk. Once we've written // the migration out, we will dump-autoload for the entire framework to // make sure that the migrations are registered by the class loaders. $this->writeMigration($name, $table, $create); } /** * Write the migration file to disk. * * @param string $name * @param string $table * @param bool $create * @return void */ protected function writeMigration($name, $table, $create) { $file = $this->creator->create( $name, $this->getMigrationPath(), $table, $create ); $this->components->info(sprintf('Migration [%s] created successfully.', $file)); } /** * Get migration path (either specified by '--path' option or default location). * * @return string */ protected function getMigrationPath() { if (! is_null($targetPath = $this->input->getOption('path'))) { return ! $this->usingRealPath() ? $this->laravel->basePath().'/'.$targetPath : $targetPath; } return parent::getMigrationPath(); } /** * Prompt for missing input arguments using the returned questions. * * @return array */ protected function promptForMissingArgumentsUsing() { return [ 'name' => ['What should the migration be named?', 'E.g. create_flights_table'], ]; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
BaseCommand.php
1.46 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FreshCommand.php
4.55 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
InstallCommand.php
1.64 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MigrateCommand.php
11.10 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MigrateMakeCommand.php
4.46 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RefreshCommand.php
4.98 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ResetCommand.php
2.71 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RollbackCommand.php
2.72 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
StatusCommand.php
4.30 KB
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TableGuesser.php
907 B
lrw-rw-rw-
2025-09-17 06:53:01
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).