mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
setup wizard init
This commit is contained in:
12
database/factories/SettingFactory.php
Normal file
12
database/factories/SettingFactory.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use App\Setting;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(Setting::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSettingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('name')->unique();
|
||||
$table->longText('value')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,6 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(PaymentGatewaysSeeder::class);
|
||||
$this->call(PlansSeeder::class);
|
||||
$this->call(InvoicesSeeder::class);
|
||||
$this->call(SettingSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,5 @@ class PaymentGatewaysSeeder extends Seeder
|
||||
'name' => 'Stripe',
|
||||
'slug' => 'stripe',
|
||||
]);
|
||||
|
||||
// Create PayPal default record
|
||||
DB::table('payment_gateways')->insert([
|
||||
'logo' => '/assets/images/paypal-logo-thumbnail.png',
|
||||
'name' => 'Paypal',
|
||||
'slug' => 'paypal',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
57
database/seeds/SettingSeeder.php
Normal file
57
database/seeds/SettingSeeder.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SettingSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$columns = collect([
|
||||
|
||||
// Service Billing Info
|
||||
['name' => 'billing_phone_number'],
|
||||
['name' => 'billing_postal_code'],
|
||||
['name' => 'billing_vat_number'],
|
||||
['name' => 'billing_address'],
|
||||
['name' => 'billing_country'],
|
||||
['name' => 'billing_state'],
|
||||
['name' => 'billing_city'],
|
||||
['name' => 'billing_name'],
|
||||
|
||||
// General Settings
|
||||
['name' => 'app_title'],
|
||||
['name' => 'app_description'],
|
||||
|
||||
['name' => 'app_logo'],
|
||||
['name' => 'app_favicon'],
|
||||
|
||||
['name' => 'google_analytics'],
|
||||
['name' => 'contact_email'],
|
||||
|
||||
// Users
|
||||
['name' => 'registration', 'value' => 1],
|
||||
['name' => 'storage_limitation', 'value' => 1],
|
||||
['name' => 'storage_default', 'value' => 1],
|
||||
|
||||
// Mail settings
|
||||
['name' => 'mail_driver'],
|
||||
['name' => 'mail_host'],
|
||||
['name' => 'mail_port'],
|
||||
['name' => 'mail_username'],
|
||||
['name' => 'mail_password'],
|
||||
['name' => 'mail_encryption'],
|
||||
]);
|
||||
|
||||
$columns->each(function ($col) {
|
||||
DB::table('settings')->insert([
|
||||
'name' => $col['name'],
|
||||
'value' => isset($col['value']) ? $col['value'] : null,
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user