laravel run query after migration

Solutions on MaxInterview for laravel run query after migration by the best coders in the world

showing results for - "laravel run query after migration"
Silvia
16 Jan 2016
1//You should be able to add data to your new fields in your new migration. I'm not sure if it's the best way to go, but I've seen something like this before:
2
3public function up()
4{
5    Schema::table('my_table', function (Blueprint $table) {
6        $table->string('my_column')->nullable();
7    });
8    $this->updateData();
9}
10
11private function updateData()
12{
13    $allCategories = Category::where('slug', null)->get();
14
15    foreach($allCategories as $singleCategory) {
16        $singleCategory->update([
17            'slug' => Category::makeSlug($singleCategory->name, $singleCategory->parent_id)
18        ]);
19    }
20}
María Fernanda
16 Feb 2018
1DB::statement("
2    CREATE TABLE `your_table` (
3        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
4        `status` tinyint(3) unsigned DEFAULT NULL,
5        PRIMARY KEY (`id`)
6      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
7");
queries leading to this page
db table insert laravel reverse migrationlaravel run old migration for one tablelaravel run a migration inside migrationlaravel get query from migrationlaravel run update query after migrationlaravel migrations execute laravlerun migration laravel commandrun migrations laravellaravel procedure migrationlaravel run migrationafter migration laravellaravel run 1 migrationmysql trigger migration laravelrun migration in laravelrun one migration again laravellaravel run query after migrationrun command in laravel migrationlaravel run migrationslaravel run query migrationlaravel migration execute sqlmigration run laravellaravel run sql in migrationlaravel migrations executerun migration laravelrun laravel migrationrun migrate after migration laravellaravel update db with migraterun migration on laravel commnaddb query inside migrations laravelhow to run migrations laravelhow to run migrations in laravelrun specigic migration in laravelhow to run migration command in laravelrun migrations php laravelrun only those migration that are not migration laravelhow to run migration in laravellaravel run update migrationlaravel create query from migrationlaravel run migrations in afolderhow to run migrate in update laravellaravel database migration with selectionlaravel migration run sqlrun migration after alter migration table laravellaravel run query in migrationlaravel run migrations on existingrun migration on laravelrun migration again laravellaravel run migration on all tableslaravel run migration commandlaravel run query after migration