Answers for "laravel execute migration"

PHP
0

re migrate laravel

Try:
composer dump-autoload
php artisan config:cache

If not working also try:
php artisan migrate:refresh.
Posted by: Guest on July-02-2020
1

laravel run query after migration

//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:

public function up()
{
    Schema::table('my_table', function (Blueprint $table) {
        $table->string('my_column')->nullable();
    });
    $this->updateData();
}

private function updateData()
{
    $allCategories = Category::where('slug', null)->get();

    foreach($allCategories as $singleCategory) {
        $singleCategory->update([
            'slug' => Category::makeSlug($singleCategory->name, $singleCategory->parent_id)
        ]);
    }
}
Posted by: Guest on August-24-2021
2

laravel make migration

php artisan make:migration CreateUsersTable
Posted by: Guest on May-04-2020
1

laravel run query migration

DB::statement("
    CREATE TABLE `your_table` (
        `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
        `status` tinyint(3) unsigned DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
");
Posted by: Guest on August-23-2021

Browse Popular Code Answers by Language