File "AddSuperAdminSeeder.php"
Full Path: /home/trinadezambia/public_html/admin_panel/database/seeders/AddSuperAdminSeeder.php
File size: 15.42 KB
MIME-type: text/x-php
Charset: utf-8
<?php
namespace Database\Seeders;
use App\Models\SystemSetting;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Hash;
use Spatie\Permission\Models\Role;
class AddSuperAdminSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//Add Super Admin User
$super_admin_role = Role::where('name', 'Super Admin')->first();
$user = User::updateOrCreate(['id' => 1], [
'first_name' => 'super',
'last_name' => 'admin',
'email' => 'superadmin@gmail.com',
'password' => Hash::make('superadmin'),
'gender' => 'male',
'image' => 'logo.svg',
'mobile' => "",
'email_verified_at' => Carbon::now(),
'two_factor_enabled' => 0,
]);
$user->assignRole([$super_admin_role->id]);
// SessionYear::updateOrCreate(['id' => 1], [
// 'name' => '2022-23',
// 'default' => 1,
// 'start_date' => '2022-06-01',
// 'end_date' => '2023-04-30',
// ]);
SystemSetting::upsert([
["name" => "time_zone", "data" => "Asia/Kolkata", "type" => "string"],
["name" => "date_format", "data" => "d-m-Y", "type" => "date"],
["name" => "time_format", "data" => "h:i A", "type" => "time"],
["name" => "theme_color", "data" => "#22577A", "type" => "string"],
["name" => "session_year", "data" => 1, "type" => "string"],
["name" => "system_version", "data" => "1.9.2", "type" => "string"],
["name" => "email_verified", "data" => 0, "type" => "boolean"],
["name" => "subscription_alert", "data" => 7, "type" => "integer"],
["name" => "currency_code", "data" => "USD", "type" => "string"],
["name" => "currency_symbol", "data" => "$", "type" => "string"],
["name" => "additional_billing_days", "data" => "5", "type" => "integer"],
["name" => "system_name", "data" => "eSchool Saas - School Management System", "type" => "string"],
["name" => "address", "data" => "#262-263, Time Square Empire, SH 42 Mirjapar highway, Bhuj - Kutch 370001 Gujarat India.", "type" => "string"],
["name" => "billing_cycle_in_days", "data" => "30", "type" => "integer"],
["name" => "current_plan_expiry_warning_days", "data" => "7", "type" => "integer"],
["name" => "front_site_theme_color", "data" => "#e9f9f3", "type" => "text"],
["name" => "primary_color", "data" => "#3ccb9b", "type" => "text"],
["name" => "secondary_color", "data" => "#245a7f", "type" => "text"],
["name" => "short_description", "data" => "eSchool-Saas - Manage Your School", "type" => "text"],
["name" => "facebook", "data" => "https://www.facebook.com/wrteam.in/", "type" => "text"],
["name" => "instagram", "data" => "https://www.instagram.com/wrteam.in/", "type" => "text"],
["name" => "linkedin", "data" => "https://in.linkedin.com/company/wrteam", "type" => "text"],
["name" => "footer_text", "data" => "<p>© <strong><a href='https://wrteam.in/' target='_blank' rel='noopener noreferrer'>WRTeam</a></strong>. All Rights Reserved</p>", "type" => "text"],
["name" => "tagline", "data" => "We Provide the best Education", "type" => "text"],
["name" => "super_admin_name", "data" => "Super Admin", "type" => "text"],
["name" => "wildcard_domain", "data" => 0, "type" => "integer"],
["name" => "notification_settings", "data" => 0, "type" => "integer"],
], ['name'], ['data', 'type']);
$systemSettings = [
[
'name' => 'hero_title_1',
'data' => 'Opt for eSchool Saas 14+ robust features for an enhanced educational experience.',
'type' => 'text'
],
[
'name' => 'hero_title_2',
'data' => 'Top Rated Instructors',
'type' => 'text'
],
[
'name' => 'about_us_title',
'data' => 'A modern and unique style',
'type' => 'text'
],
[
'name' => 'about_us_heading',
'data' => 'Why it is best?',
'type' => 'text'
],
[
'name' => 'about_us_description',
'data' => 'eSchool is the pinnacle of school management, offering advanced technology, user-friendly features, and personalized solutions. It simplifies communication, streamlines administrative tasks, and elevates the educational experience for all stakeholders. With eSchool, excellence in education management is guaranteed.',
'type' => 'text'
],
[
'name' => 'about_us_points',
'data' => 'Affordable price,Easy to manage admin panel,Data Security',
'type' => 'text'
],
[
'name' => 'custom_package_status',
'data' => '1',
'type' => 'text'
],
[
'name' => 'custom_package_description',
'data' => 'Tailor your experience with our custom package options. From personalized services to bespoke solutions, we offer flexibility to meet your unique needs.',
'type' => 'text'
],
[
'name' => 'download_our_app_description',
'data' => 'Join the ranks of true trivia champions and quench your thirst for knowledge with Masters of Trivia - the ultimate quiz app designed to test your wits and unlock a world of fun facts. Challenge your brain, compete with friends, and discover fascinating tidbits from diverse categories. Don\'t miss out on the exhilarating experience that awaits you - get started now!Join the ranks of true trivia champions and quench your thirst for knowledge with Masters of Trivia - the ultimate quiz app designed to test your wits and unlock a world of fun facts.',
'type' => 'text'
],
[
'name' => 'theme_primary_color',
'data' => '#56cc99',
'type' => 'text'
],
[
'name' => 'theme_secondary_color',
'data' => '#215679',
'type' => 'text'
],
[
'name' => 'theme_secondary_color_1',
'data' => '#38a3a5',
'type' => 'text'
],
[
'name' => 'theme_primary_background_color',
'data' => '#f2f5f7',
'type' => 'text'
],
[
'name' => 'theme_text_secondary_color',
'data' => '#5c788c',
'type' => 'text'
],
[
'name' => 'tag_line',
'data' => 'Transform School Management With eSchool SaaS',
'type' => 'text'
],
[
'name' => 'mobile',
'data' => 'xxxxxxxxxx',
'type' => 'text'
],
[
'name' => 'hero_description',
'data' => 'Experience the future of education with our eSchool SaaS platform. Streamline attendance, assignments, exams, and more. Elevate your school\'s efficiency and engagement.',
'type' => 'text'
],
[
'name' => 'display_school_logos',
'data' => '1',
'type' => 'text'
],
[
'name' => 'display_counters',
'data' => '1',
'type' => 'text'
],
[
'name' => 'email_template_school_registration',
'data' => '<p>Dear {school_admin_name},</p> <p>Welcome to {system_name}!</p> <p>We are excited to have you as part of our educational community. Below are your registration details to access the system:</p> <hr> <p><strong>School Name:</strong> {school_name}</p> <p><strong>System URL:</strong> {url}</p> <p><strong>Your Login Credentials:</strong></p> <ul> <li><strong>Email:</strong> {email}</li> <li><strong>Password:</strong> {password}</li> <li><strong>School Code:</strong> {code}</li> </ul> <hr> <p><strong>Please follow these steps to complete your registration:</strong></p> <ol> <li>Click on the system URL provided above.</li> <li>Enter your email and password.</li> <li>Follow the instructions to complete your profile setup.</li> </ol> <p><strong>Important:</strong></p> <ul> <li>For security reasons, please change your password after your first login.</li> <li>If you encounter any issues during the registration process, please do not hesitate to contact our support team at {support_email} or call {contact}.</li> </ul> <p>Thank you for choosing {system_name}. We are committed to providing you with the best educational tools and resources.</p> <p>Best regards,</p> <p>{super_admin_name}<br>{system_name}<br>{support_email}<br>{url}</p> <br> <p><strong>This email was auto-generated, so don\'t reply.</strong></p>',
'type' => 'text'
],
[
'name' => 'web_maintenance',
'data' => '0',
'type' => 'string'
],
[
'name' => 'file_upload_size_limit',
'data' => '2',
'type' => 'string'
],
[
'name' => 'email_template_two_factor_authentication_code',
'data' => '<p>Dear {school_admin_name},</p> <p>Welcome to {system_name}!</p> <p>We are excited to have you as part of our educational community. To enhance the security of your account, we have enabled Two-Factor Authentication (2FA) for your login.</p> <p><strong>Your Verification Code:</strong></p> <p><strong>{verification_code}</strong></p> <p>This verification code is required to complete your login process. Please enter the code within the next {expiration_time} minutes. If the code expires, you can request a new one by following the same process.</p> <hr> <p><strong>Important:</strong></p> <ul> <li>If you did not request this verification code, please contact our support team immediately at {support_email} or call {support_contact} to secure your account.</li> <li>For additional security, ensure that no one else has access to your email or device when retrieving your verification code.</li> </ul> <p>If you have any issues with the 2FA process or need assistance, our support team is ready to help at {support_email} or {support_contact}.</p> <p>Thank you for taking extra steps to secure your account. We appreciate your commitment to keeping your information safe.</p> <p>Best regards,</p> <p>{super_admin_name}<br>{system_name}<br>{support_email}<br>{url}</p> <br> <p><strong>This email was auto-generated, so please do not reply.</strong></p>',
'type' => 'text'
],
[
'name' => 'wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'system_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'notification_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'email_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'verify_email_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'email_template_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'payment_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'third_party_api_settings_wizard_checkMark',
'data' => 0,
'type' => 'integer'
],
[
'name' => 'school_reject_template',
'data' => '<p>Dear {school_name},</p>' .
'<p>Thank you for submitting your school's application to join our organization. We value the effort you put into the process and your interest in partnering with us.</p>' .
'<p>After careful review, we regret to inform you that your application has not been approved at this time.</p>' .
'<p>We encourage you to review the application criteria outlined on our platform and reapply in the future if circumstances allow. Our team is here to support you, so please don't hesitate to reach out to us at {support_email} for further clarification or guidance.</p>' .
'<p>We sincerely appreciate your understanding and look forward to the opportunity to collaborate in the future.</p>' .
'<p>Warm regards,</p>' .
'<p>{super_admin_name}</p>' .
'<p>{support_email}</p>' .
'<p>{contact}&nbsp;</p>',
'type' => 'text'
],
[
'name' => 'school_inquiry_template',
'data' => '<p>Dear Super Admin,</p>' .
'<p>We hope this message finds you well.</p>' .
'<p>You have received a new school inquiry through the website. Please find the details below:</p>' .
'<hr>' .
'<p><strong>School Name:</strong> {school_name}<br><strong>Contact Person:</strong> {contact}<br><strong>Email Address:</strong> {school_email}<br><strong>Address:</strong> {address}</p>' .
'<hr>' .
'<p>Please reach out to the school representative at your earliest convenience to follow up on their inquiry and provide any required assistance or information.</p>' .
'<p>If you need further support, feel free to contact the admin team.</p>' .
'<p>Warm regards,<br>{system_name}</p>',
'type' => 'text'
]
];
SystemSetting::upsert($systemSettings, ["name"], ["data", "type"]);
Cache::flush();
}
}