chore: add admin seeder & add collation only to mysql database in plans table and activation table
This commit is contained in:
1862
composer.lock
generated
1862
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -15,8 +15,14 @@ return new class extends Migration
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->text('description')->nullable();
|
$table->text('description')->nullable();
|
||||||
$table->string('product_id')->collation('utf8_bin');
|
$productId = $table->string('product_id');
|
||||||
$table->string('pricing_id')->collation('utf8_bin');
|
$pricingId = $table->string('pricing_id');
|
||||||
|
|
||||||
|
// Apply collation only for MySQL
|
||||||
|
if (Schema::getConnection()->getDriverName() === 'mysql') {
|
||||||
|
$productId->collation('utf8_bin');
|
||||||
|
$pricingId->collation('utf8_bin');
|
||||||
|
}
|
||||||
$table->integer('price');
|
$table->integer('price');
|
||||||
$table->integer('mailbox_limit')->default(15);
|
$table->integer('mailbox_limit')->default(15);
|
||||||
$table->boolean('monthly_billing')->default(true);
|
$table->boolean('monthly_billing')->default(true);
|
||||||
|
|||||||
@@ -15,7 +15,12 @@ return new class extends Migration
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
|
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
|
||||||
$table->string('activation_key')->unique();
|
$table->string('activation_key')->unique();
|
||||||
$table->string('price_id')->collation('utf8_bin');
|
$priceId = $table->string('price_id');
|
||||||
|
|
||||||
|
// Apply collation only for MySQL
|
||||||
|
if (Schema::getConnection()->getDriverName() === 'mysql') {
|
||||||
|
$priceId->collation('utf8_bin');
|
||||||
|
}
|
||||||
$table->boolean('is_activated')->default(false);
|
$table->boolean('is_activated')->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|||||||
25
database/seeders/AdminSeeder.php
Normal file
25
database/seeders/AdminSeeder.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class AdminSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
User::create([
|
||||||
|
'name' => 'admin',
|
||||||
|
'email' => 'admin@zemail.me',
|
||||||
|
'password' => Hash::make('password'),
|
||||||
|
'level' => 9,
|
||||||
|
'email_verified_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
// User::factory(10)->create();
|
// User::factory(10)->create();
|
||||||
$this->call([
|
$this->call([
|
||||||
MetaSeeder::class,
|
MetaSeeder::class,
|
||||||
|
AdminSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user