/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call(BillTableSeeder::class); $this->call(CategoryTableSeeder::class); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call('NestedEntitiesTableSeeder'); $this->command->info('NestedEntitiesTable seeded.'); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call(UserTableSeeder::class); $tbis->call(EventsTableSeeder::class); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createAffiliateTypes(); $this->createStateType(); $this->createaffiliateState(); Eloquent::reguard(); }
/** * Return the versioned model * @return mixed */ public function getModel() { $model = new $this->versionable_type(); \Eloquent::unguard(); $model->fill(unserialize($this->model_data)); $model->exists = true; \Eloquent::reguard(); return $model; }
/** * Migrates the database. * */ private function prepareForTests() { Artisan::call('migrate:reset'); Artisan::call('migrate'); Eloquent::unguard(); // create roles $this->generateRoles(); Eloquent::reguard(); // reset redis db App::make('redis')->flushAll(); }
public function run() { Eloquent::unguard(); $industries = [['name' => 'Accounting & Legal'], ['name' => 'Advertising'], ['name' => 'Aerospace'], ['name' => 'Agriculture'], ['name' => 'Automotive'], ['name' => 'Banking & Finance'], ['name' => 'Biotechnology'], ['name' => 'Broadcasting'], ['name' => 'Business Services'], ['name' => 'Commodities & Chemicals'], ['name' => 'Communications'], ['name' => 'Computers & Hightech'], ['name' => 'Defense'], ['name' => 'Energy'], ['name' => 'Entertainment'], ['name' => 'Government'], ['name' => 'Healthcare & Life Sciences'], ['name' => 'Insurance'], ['name' => 'Manufacturing'], ['name' => 'Marketing'], ['name' => 'Media'], ['name' => 'Nonprofit & Higher Ed'], ['name' => 'Pharmaceuticals'], ['name' => 'Professional Services & Consulting'], ['name' => 'Real Estate'], ['name' => 'Retail & Wholesale'], ['name' => 'Sports'], ['name' => 'Transportation'], ['name' => 'Travel & Luxury'], ['name' => 'Other'], ['name' => 'Photography'], ['name' => 'Construction']]; foreach ($industries as $industry) { $record = Industry::whereName($industry['name'])->first(); if (!$record) { Industry::create($industry); } } Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); //$this->call(UserTableSeeder::class); Model::reguard(); Eloquent::unguard(); $this->call(UserTableSeeder::class); $this->call(ChallengeTableSeeder::class); $this->call(QuestionTableSeeder::class); $this->call(OptionTableSeeder::class); $this->call(ResultTableSeeder::class); //$this->call(MiddleTableSeeder::class); Eloquent::reguard(); }
public function run() { Eloquent::unguard(); $languages = [['name' => 'English', 'locale' => 'en'], ['name' => 'Italian', 'locale' => 'it'], ['name' => 'German', 'locale' => 'de'], ['name' => 'French', 'locale' => 'fr'], ['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR'], ['name' => 'Dutch', 'locale' => 'nl'], ['name' => 'Spanish', 'locale' => 'es'], ['name' => 'Norwegian', 'locale' => 'nb_NO'], ['name' => 'Danish', 'locale' => 'da'], ['name' => 'Japanese', 'locale' => 'ja'], ['name' => 'Swedish', 'locale' => 'sv'], ['name' => 'Spanish - Spain', 'locale' => 'es_ES'], ['name' => 'French - Canada', 'locale' => 'fr_CA'], ['name' => 'Lithuanian', 'locale' => 'lt'], ['name' => 'Polish', 'locale' => 'pl'], ['name' => 'Czech', 'locale' => 'cs']]; foreach ($languages as $language) { $record = Language::whereLocale($language['locale'])->first(); if ($record) { $record->name = $language['name']; $record->save(); } else { Language::create($language); } } Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); // Delete all records Submission::whereNotNull('id')->delete(); Form::whereNotNull('id')->delete(); $form1 = Form::create(['slug' => 'the-test', 'title' => 'Nice test Form']); $form1->fields()->save(new Field(['slug' => 'name', 'title' => 'Name', 'rules' => 'required|string'])); $form1->fields()->save(new Field(['slug' => 'rating', 'title' => 'Rating', 'rules' => 'required|integer|min:1|max:5'])); $form2 = Form::create(['slug' => 'test-with-email-confirmation', 'title' => 'Test that sends email confirmation', 'confirmation_message' => 'Thanks for the message !', 'confirmation_email_field' => 'email', 'owner_email' => '*****@*****.**', 'owner_name' => 'That Company']); $form2->fields()->save(new Field(['slug' => 'email', 'title' => 'Email', 'rules' => 'required|email'])); Form::create(['slug' => 'test-with-email-notification', 'title' => 'Test with email notification', 'send_email_to' => 'john@example.com,max@example.com', 'owner_email' => '*****@*****.**', 'owner_name' => 'That Company']); Form::create(['slug' => 'test-with-redirect', 'title' => 'Test with a redirect', 'redirect_to_url' => 'https://example.com/']); Form::create(['slug' => 'test-closed', 'title' => 'Closed form test', 'accept_submissions' => false]); Eloquent::reguard(); }
public function run() { Eloquent::unguard(); // https://github.com/caouecs/Laravel-lang // https://www.loc.gov/standards/iso639-2/php/code_list.php $languages = [['name' => 'English', 'locale' => 'en'], ['name' => 'Italian', 'locale' => 'it'], ['name' => 'German', 'locale' => 'de'], ['name' => 'French', 'locale' => 'fr'], ['name' => 'Brazilian Portuguese', 'locale' => 'pt_BR'], ['name' => 'Dutch', 'locale' => 'nl'], ['name' => 'Spanish', 'locale' => 'es'], ['name' => 'Norwegian', 'locale' => 'nb_NO'], ['name' => 'Danish', 'locale' => 'da'], ['name' => 'Japanese', 'locale' => 'ja'], ['name' => 'Swedish', 'locale' => 'sv'], ['name' => 'Spanish - Spain', 'locale' => 'es_ES'], ['name' => 'French - Canada', 'locale' => 'fr_CA'], ['name' => 'Lithuanian', 'locale' => 'lt'], ['name' => 'Polish', 'locale' => 'pl'], ['name' => 'Czech', 'locale' => 'cs'], ['name' => 'Croatian', 'locale' => 'hr'], ['name' => 'Albanian', 'locale' => 'sq']]; foreach ($languages as $language) { $record = Language::whereLocale($language['locale'])->first(); if ($record) { $record->name = $language['name']; $record->save(); } else { Language::create($language); } } Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call('UserTableSeeder'); $this->call('residenciasTableSeeder'); $this->Call('AreasTableSeeder'); $this->Call('FacturasTableSeeder'); $this->Call('NoticiasTableSeeder'); $this->Call('EncuestasTableSeeder'); $this->Call('DirectivaTableSeeder'); $this->Call('PersonalTableSeeder'); $this->Call('SolvenciaTableSeeder'); $this->Call('VehiculosTableSeeder'); $this->Call('VisitantesTableSeeder'); $this->Call('DocumentosTableSeeder'); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->call('UserTableSeeder'); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createRequirements(); Eloquent::reguard(); }
public function run() { Eloquent::unguard(); $this->createPaymentStatuses(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createRetirementFundModalities(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createContributionTypes(); Eloquent::reguard(); }
/** * Run the seeder if it exists * @return void */ public function seed() { // Get Seeders $class = $this->def('seeder'); // Check Seeders Available if ($class) { // Confirm Array List if (!is_array($class)) { $class = array($class); } // Unguard Eloquent \Eloquent::unguard(); // Loop Each Seed foreach ($class as $c) { // Confirm Class Exists if (class_exists($c)) { // Create Seeder Instance & Run $seeder = new $c(); $seeder->run(); } } // Reguard Eloquent \Eloquent::reguard(); } }
public function tearDown() { parent::tearDown(); // Renables any ability to throw mass assignment exceptions Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createBaseWages(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createVoucherType(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createIpcRates(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createBreakdowns(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createAntecedentFiles(); Eloquent::reguard(); }
public function run() { Eloquent::unguard(); $this->createInvoiceStatuses(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createAdmin(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createApplicantTypes(); Eloquent::reguard(); }
/** * Run the database seeds. * * @return void */ public function run() { Eloquent::unguard(); $this->createCategories(); Eloquent::reguard(); }
public function updateRolesResources() { $roles = Acl::getRoles(); \Eloquent::unguard(); Acl::runUnguardCallback(function () use($roles) { /* @var $role \Volicon\Acl\AclRole */ foreach ($roles as $role) { $role->update(); } }); \Eloquent::reguard(); }
/** * Run the migrations. * * @return void */ public function up() { Schema::dropIfExists('payment_statuses'); Schema::create('payment_statuses', function ($table) { $table->increments('id'); $table->string('name'); }); $statuses = [['id' => '1', 'name' => 'Pending'], ['id' => '2', 'name' => 'Voided'], ['id' => '3', 'name' => 'Failed'], ['id' => '4', 'name' => 'Completed'], ['id' => '5', 'name' => 'Partially Refunded'], ['id' => '6', 'name' => 'Refunded']]; Eloquent::unguard(); foreach ($statuses as $status) { $record = PaymentStatus::find($status['id']); if ($record) { $record->name = $status['name']; $record->save(); } else { PaymentStatus::create($status); } } Eloquent::reguard(); Schema::dropIfExists('payment_methods'); Schema::create('payment_methods', function ($table) { $table->increments('id'); $table->unsignedInteger('account_id'); $table->unsignedInteger('user_id'); $table->unsignedInteger('contact_id')->nullable(); $table->unsignedInteger('account_gateway_token_id'); $table->unsignedInteger('payment_type_id'); $table->string('source_reference'); $table->unsignedInteger('routing_number')->nullable(); $table->smallInteger('last4')->unsigned()->nullable(); $table->date('expiration')->nullable(); $table->string('email')->nullable(); $table->unsignedInteger('currency_id')->nullable(); $table->string('status')->nullable(); $table->timestamps(); $table->softDeletes(); $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('contact_id')->references('id')->on('contacts')->onDelete('cascade'); $table->foreign('account_gateway_token_id')->references('id')->on('account_gateway_tokens'); $table->foreign('payment_type_id')->references('id')->on('payment_types'); $table->foreign('currency_id')->references('id')->on('currencies'); $table->unsignedInteger('public_id')->index(); $table->unique(array('account_id', 'public_id')); }); Schema::table('payments', function ($table) { $table->decimal('refunded', 13, 2); $table->unsignedInteger('payment_status_id')->default(PAYMENT_STATUS_COMPLETED); $table->unsignedInteger('routing_number')->nullable(); $table->smallInteger('last4')->unsigned()->nullable(); $table->date('expiration')->nullable(); $table->text('gateway_error')->nullable(); $table->string('email')->nullable(); $table->unsignedInteger('payment_method_id')->nullable(); }); Schema::table('payments', function ($table) { $table->foreign('payment_status_id')->references('id')->on('payment_statuses'); $table->foreign('payment_method_id')->references('id')->on('payment_methods'); }); Schema::table('invoices', function ($table) { $table->boolean('client_enable_auto_bill')->default(false); }); \DB::table('invoices')->where('auto_bill', '=', 1)->update(array('client_enable_auto_bill' => 1, 'auto_bill' => AUTO_BILL_OPT_OUT)); \DB::table('invoices')->where('auto_bill', '=', 0)->where('is_recurring', '=', 1)->update(array('auto_bill' => AUTO_BILL_OFF)); Schema::table('account_gateway_tokens', function ($table) { $table->unsignedInteger('default_payment_method_id')->nullable(); }); Schema::table('account_gateway_tokens', function ($table) { $table->foreign('default_payment_method_id')->references('id')->on('payment_methods'); }); }