本文整理汇总了PHP中Eloquent::reguard方法的典型用法代码示例。如果您正苦于以下问题:PHP Eloquent::reguard方法的具体用法?PHP Eloquent::reguard怎么用?PHP Eloquent::reguard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eloquent
的用法示例。
在下文中一共展示了Eloquent::reguard方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call(BillTableSeeder::class);
$this->call(CategoryTableSeeder::class);
Eloquent::reguard();
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('NestedEntitiesTableSeeder');
$this->command->info('NestedEntitiesTable seeded.');
Eloquent::reguard();
}
示例3: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call(UserTableSeeder::class);
$tbis->call(EventsTableSeeder::class);
Eloquent::reguard();
}
示例4: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->createAffiliateTypes();
$this->createStateType();
$this->createaffiliateState();
Eloquent::reguard();
}
示例5: getModel
/**
* 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;
}
示例6: prepareForTests
/**
* 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();
}
示例7: run
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();
}
示例8: run
/**
* 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();
}
示例9: run
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();
}
示例10: run
/**
* 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' => 'info@company.com', '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' => 'info@company.com', '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();
}
示例11: run
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();
}
示例12: run
/**
* 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();
}
示例13: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->call('UserTableSeeder');
Eloquent::reguard();
}
示例14: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
$this->createRequirements();
Eloquent::reguard();
}
示例15: run
public function run()
{
Eloquent::unguard();
$this->createPaymentStatuses();
Eloquent::reguard();
}