2018-10-09 16:12:26 -07:00
|
|
|
<?php
|
2021-06-10 13:15:52 -07:00
|
|
|
|
2021-06-10 13:18:00 -07:00
|
|
|
namespace Database\Seeders;
|
|
|
|
|
2018-10-09 16:12:26 -07:00
|
|
|
use App\Models\Setting;
|
|
|
|
use App\Models\User;
|
2021-06-10 13:15:52 -07:00
|
|
|
use Illuminate\Database\Seeder;
|
2021-06-10 13:19:27 -07:00
|
|
|
use Illuminate\Support\Facades\Storage;
|
2018-10-09 16:12:26 -07:00
|
|
|
|
|
|
|
class SettingsSeeder extends Seeder
|
|
|
|
{
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
Setting::truncate();
|
|
|
|
$settings = new Setting;
|
|
|
|
$settings->per_page = 20;
|
|
|
|
$settings->site_name = 'Snipe-IT Demo';
|
|
|
|
$settings->auto_increment_assets = 1;
|
2020-12-21 11:36:43 -08:00
|
|
|
$settings->logo = 'snipe-logo.png';
|
2018-10-09 16:12:26 -07:00
|
|
|
$settings->alert_email = 'service@snipe-it.io';
|
|
|
|
$settings->header_color = null;
|
|
|
|
$settings->barcode_type = 'QRCODE';
|
|
|
|
$settings->default_currency = 'USD';
|
|
|
|
$settings->brand = 3;
|
|
|
|
$settings->ldap_enabled = 0;
|
|
|
|
$settings->full_multiple_companies_support = 0;
|
|
|
|
$settings->alt_barcode = 'C128';
|
|
|
|
$settings->skin = '';
|
|
|
|
$settings->email_domain = 'example.org';
|
|
|
|
$settings->email_format = 'filastname';
|
|
|
|
$settings->username_format = 'filastname';
|
|
|
|
$settings->date_display_format = 'D M d, Y';
|
|
|
|
$settings->time_display_format = 'g:iA';
|
|
|
|
$settings->thumbnail_max_h = '30';
|
2023-12-24 12:14:49 -08:00
|
|
|
$settings->locale = 'en-US';
|
2018-10-09 16:12:26 -07:00
|
|
|
$settings->version_footer = 'on';
|
|
|
|
$settings->support_footer = 'on';
|
2019-12-10 19:32:50 -08:00
|
|
|
$settings->pwd_secure_min = '8';
|
2024-07-19 16:59:25 -07:00
|
|
|
$settings->default_avatar = 'default.png';
|
2018-10-09 16:12:26 -07:00
|
|
|
$settings->save();
|
|
|
|
|
|
|
|
if ($user = User::where('username', '=', 'admin')->first()) {
|
2023-12-24 12:14:49 -08:00
|
|
|
$user->locale = 'en-US';
|
2018-10-09 16:12:26 -07:00
|
|
|
$user->save();
|
|
|
|
}
|
2021-03-09 17:39:10 -08:00
|
|
|
|
|
|
|
// Copy the logos from the img/demo directory
|
2021-05-12 16:41:49 -07:00
|
|
|
Storage::disk('local_public')->put('snipe-logo.png', file_get_contents(public_path('img/demo/snipe-logo.png')));
|
|
|
|
Storage::disk('local_public')->put('snipe-logo-lg.png', file_get_contents(public_path('img/demo/snipe-logo-lg.png')));
|
2018-10-09 16:12:26 -07:00
|
|
|
}
|
|
|
|
}
|