unguard() public static method

Disable all mass assignable restrictions.
public static unguard ( boolean $state = true ) : void
$state boolean
return void
Example #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement("SET foreign_key_checks = 0");
     DB::table('roles')->truncate();
     DB::table('role_user')->truncate();
     DB::table('users')->truncate();
     DB::table('berita')->truncate();
     DB::table('kontak')->truncate();
     $this->call(UserTableSeeder::class);
     $this->call(BeritaTableSeeder::class);
     $this->call(KontakTableSeeder::class);
     $admin = App\User::find(1);
     $admin->attachRole(1);
     $mahasiswa = App\User::find(2);
     $mahasiswa->attachRole(2);
     $akademik = App\User::find(3);
     $akademik->attachRole(3);
     $rektor = App\User::find(4);
     $rektor->attachRole(4);
     $dekan = App\User::find(5);
     $dekan->attachRole(5);
     $kemahasiswaan = App\User::find(6);
     $kemahasiswaan->attachRole(6);
     $prodi = App\User::find(7);
     $prodi->attachRole(7);
     Model::reguard();
 }
Example #2
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     /**
      * Disable foreign key checks for this
      * connection before running seeders.
      */
     DB::statement('SET FOREIGN_KEY_CHECKS = 0;');
     $this->call('AlertsTableSeeder');
     $this->call('CheckCategoriesTableSeeder');
     $this->call('ChecksTableSeeder');
     $this->call('CheckResultsTableSeeder');
     $this->call('DatabaseTechnologiesTableSeeder');
     $this->call('EnvironmentsTableSeeder');
     $this->call('OperatingSystemsTableSeeder');
     $this->call('ReportLevelsTableSeeder');
     $this->call('ReportTypesTableSeeder');
     $this->call('TicketCategoriesTableSeeder');
     $this->call('TicketPrioritiesTableSeeder');
     $this->call('TicketTypesTableSeeder');
     /**
      * Will not seed clients, services, servers, and server check
      * results if this is the production environment.
      */
     if (getenv('APP_ENV') !== 'production') {
         $this->call('ClientsTableSeeder');
         $this->call('ServicesTableSeeder');
         $this->call('SitesTableSeeder');
         $this->call('ServersTableSeeder');
         $this->call('ServerCheckResultsTableSeeder');
     }
     // Reset foreign key checks.
     DB::statement('SET FOREIGN_KEY_CHECKS = 1;');
 }
Example #3
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call('UserTableSeeder');
     $this->call('UsersSeeder');
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     factory('App\\User', 100)->create();
     Model::reguard();
     // $this->call(UserTableSeeder::class);
 }
Example #5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     $this->call(SudoAdminUser::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(CountriesSeeder::class);
     $this->call(UsersSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     //Sermon seeding
     $this->call('SermonSeeder');
     $this->command->info('Sermons table seeded!');
     // Users seeding
     DB::table('users')->delete();
     DB::table('password_reminders')->delete();
     DB::table('permission_role')->delete();
     DB::table('assigned_roles')->delete();
     DB::table('roles')->delete();
     DB::table('permissions')->delete();
     $this->call('PermissionSeeder');
     $this->command->info('Permissions table seeded!');
     $this->call('RoleSeeder');
     $this->command->info('Roles tables seeded!');
     $this->call('UserSeeder');
     $this->command->info('Users tables seeded!');
     // Pages seeding
     // !!Do not use, as there is no way of seeding the pages table!!
     //$this->call('PageSeeder');
     //$this->command->info('Pages table seeded!');
     // Document seeding
     $this->call('DocumentSeeder');
     $this->command->info('Documents table seeded!');
 }
Example #8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     DB::table('users')->insert(['email' => str_random(10) . '@gmail.com', 'name' => str_random(10), 'lastname' => str_random(10), 'password' => bcrypt('secret')]);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(ApplicationSeeder::class);
     $this->call(ActorSeeder::class);
     Model::reguard();
 }
Example #10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $this->cleanDatabase();
     Model::unguard();
     $this->call('UserTableSeeder');
     Model::reguard();
 }
Example #11
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(CreateUsersSeeder::class);
     $this->call(CreateEverythingSeeder::class);
     Model::reguard();
 }
Example #12
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(UserSeeder::class);
     $this->call(InterestsTableSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     $this->call(user::class);
     $this->call(article::class);
 }
Example #14
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call('CategoriesTableSeeder');
     $this->call('BlogsTableSeeder');
     // $this->call('UserTableSeeder');
 }
Example #15
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     if (User::count()) {
         return;
     }
     User::whereNotNull('id')->delete();
     Model::unguard();
     $users = User::all();
     $users = [['id' => 1, 'name' => 'محسن بخيش', 'email' => '*****@*****.**', 'password' => bcrypt("123456")], ['name' => 'هيثم', 'email' => 'haitham.hamdy@css.edu.om ', 'password' => bcrypt("123456")], ['name' => 'سامي', 'email' => 'samialmamari@css.edu.om ', 'password' => bcrypt("123456")], ['name' => 'احمد', 'email' => 'aalkindi@css.edu.om ', 'password' => bcrypt("123456")]];
     foreach ($users as $user) {
         User::create($user);
     }
     $permissions = [['module' => 'users', 'name' => 'اضافة مستخدم', 'slug' => 'create.users'], ['module' => 'users', 'name' => 'حذف مستخدم', 'slug' => 'delete.users'], ['module' => 'users', 'name' => 'تعديل مستخدم', 'slug' => 'edit.users'], ['module' => 'users', 'name' => 'مشاهدة المستخدمين', 'slug' => 'view.users'], ['module' => 'users', 'name' => 'اضافة صلاحية', 'slug' => 'create.roles'], ['module' => 'users', 'name' => 'حذف صلاحية', 'slug' => 'delete.roles'], ['module' => 'users', 'name' => 'تعديل صلاحية', 'slug' => 'edit.roles'], ['module' => 'users', 'name' => 'مشاهدة الصلاحيات', 'slug' => 'view.roles']];
     $slugs = array_map(function ($ar) {
         return $ar['slug'];
     }, $permissions);
     $users = User::all();
     Permission::whereIn('slug', $slugs)->delete();
     foreach ($permissions as $permission) {
         $perm = Permission::create($permission);
         foreach ($users as $user) {
             $user->attachPermission($perm);
         }
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // Estados
     $this->call('EstadosTableSeeder');
     // Cidades
     $this->call('CidadesAcreSeeder');
     $this->call('CidadesAlagoasSeeder');
     $this->call('CidadesAmapaSeeder');
     $this->call('CidadesAmazonasSeeder');
     $this->call('CidadesBahiaSeeder');
     $this->call('CidadesCearaSeeder');
     $this->call('CidadesDistritoFederalSeeder');
     $this->call('CidadesEspiritoSantoSeeder');
     $this->call('CidadesGoiasSeeder');
     $this->call('CidadesMaranhaoSeeder');
     $this->call('CidadesMatoGrossoSeeder');
     $this->call('CidadesMatoGrossoDoSulSeeder');
     $this->call('CidadesMinasGeraisSeeder');
     $this->call('CidadesParaSeeder');
     $this->call('CidadesParaibaSeeder');
     $this->call('CidadesParanaSeeder');
     $this->call('CidadesPernambucoSeeder');
     $this->call('CidadesPiauiSeeder');
     $this->call('CidadesRioDeJaneiroSeeder');
     $this->call('CidadesRioGrandeDoNorteSeeder');
     $this->call('CidadesRioGrandeDoSulSeeder');
     $this->call('CidadesRondoniaSeeder');
     $this->call('CidadesRoraimaSeeder');
     $this->call('CidadesSantaCatarinaSeeder');
     $this->call('CidadesSaoPauloSeeder');
     $this->call('CidadesSergipeSeeder');
     $this->call('CidadesTocantinsSeeder');
 }
Example #17
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     $this->call(ArticleTableSeeder::class);
     $this->call(UserTableSeeder::class);
     $this->call(RoleTableSeeder::class);
     $this->call(CategoryTableSeeder::class);
     $this->call(DailyEventTableSeeder::class);
     $this->call(WeekTableSeeder::class);
     $this->call(ClanTableSeeder::class);
     $this->call(SliderTableSeeder::class);
     $this->call(GalaryTableSeeder::class);
     $this->call(PopupTableSeeder::class);
     $this->call(CardTableSeeder::class);
     $this->call(CardUserTableSeeder::class);
     $this->call(GiftTableSeeder::class);
     $this->call(GiftUsersTableSeeder::class);
     $this->call(ServerTableSeeder::class);
     $this->call(CharacterTbaleSeeder::class);
     $this->call(ItemsTableSeeder::class);
     $this->call(ItemTypeTableSeeder::class);
     $this->call(GiftFresherTableSeeder::class);
     $this->call(QuaDatMocTableSeeder::class);
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     Model::reguard();
 }
Example #18
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     $this->call('PostsSeeder');
     //Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(ArticleTableSeeder::class);
     $this->call(CommentTableSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $data = json_decode(file_get_contents('database/scraped/coursesFall2016.json'));
     foreach ($data as $course) {
         // Requirements for course
         $faculty_id = Faculty::firstOrCreate(['name' => $course->faculty])->id;
         $name = substr($course->title, 0, -2);
         $number = $course->classNum;
         $credits = 3.0;
         // TODO delete this from the database
         $description = 'No description of the course.';
         // TODO maybe delete this from the database
         // end requirements for course
         // Requirements for scheduled_course
         $course_id = Course::firstOrCreate(['name' => $name, 'number' => $number, 'credits' => $credits, 'description' => $description, 'faculty_id' => $faculty_id])->id;
         $session_id = Session::firstOrCreate(['name' => $course->semester])->id;
         // end requirements for scheduled_course
         // Requirements for time_slot
         $scheduled_course_id = ScheduledCourse::firstOrCreate(['course_id' => $course_id, 'session_id' => $session_id])->id;
         if ($course->day != 'TBA') {
             $section = $course->section;
             $room = $course->room;
             $time_start = $course->timeBegin;
             $time_end = $course->timeEnd;
             $course_type_id = $this->getType($course->type)->id;
             //                $days = explode(';', preg_replace('/;$/', '', chunk_split($course->day, 2, ';')));
             $day = $course->day;
             //                    $day_of_week_id = $this->getDay($day)->id;
             TimeSlot::firstOrCreate(['scheduled_course_id' => $scheduled_course_id, 'section' => $section, 'room' => $room, 'time_start' => $time_start, 'time_end' => $time_end, 'day' => $day, 'course_type_id' => $course_type_id]);
         }
     }
     Model::reguard();
 }
Example #21
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(AdminUserSeeder::class);
     $this->call(StoresTableSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call('UserTableSeeder');
     \App\Editor::create(['first_name' => 'Andy', 'last_name' => 'Crockett', 'email' => '*****@*****.**', 'password' => bcrypt('cotton')]);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // $this->call(UserTableSeeder::class);
     //$this->call(CountryTableSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     $this->call(RolesTableSeeder::class);
     DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     Label::create(['name' => 'favorite']);
     Label::create(['name' => 'trashed']);
     Setting::insert([['name' => 'homeTagline', 'value' => 'Syntropy Cloud, Your Cloud Your Way'], ['name' => 'homeByline', 'value' => 'Register or Login now to upload, backup, manage and access your files on any device, from anywhere, free.'], ['name' => 'homeButtonText', 'value' => 'Register Now'], ['name' => 'homepage', 'value' => 'landing'], ['name' => 'blacklist', 'value' => 'exe, application/x-msdownload, x-dosexec'], ['name' => 'maxFileSize', 'value' => 20], ['name' => 'maxUserSpace', 'value' => 104857600], ['name' => 'enableRegistration', 'value' => 1], ['name' => 'siteName', 'value' => 'CryptOffice'], ['name' => 'enableHomeUpload', 'value' => 1], ['name' => 'maxSimultUploads', 'value' => 10], ['name' => 'enablePushState', 'value' => 0], ['name' => 'dateLocale', 'value' => 'en'], ['name' => 'pushStateRootUrl', 'value' => '/'], ['name' => 'disqusShortname', 'value' => 'cryptoffice'], ['name' => 'enablePayments', 'value' => 1]]);
 }
Example #26
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(AuthorsTableSeeder::class);
     $this->call(BooksTableSeeder::class);
     Model::reguard();
 }
Example #27
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     DB::table('cijfer')->truncate();
     $toetsen = Toets::all();
     //$cijfers = factory(Cijfer::class, count($toetsen)*count($leerlingen))->create();
     for ($i = 0; $i < count($toetsen); ++$i) {
         //dd($toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->leerlingen()->first());
         $klas = $toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->code;
         if (substr($klas, 0, 1) != '5') {
             continue;
         }
         $leerlingen = $toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->leerlingen()->get();
         for ($j = 0; $j < count($leerlingen); ++$j) {
             $cijfer = factory(Cijfer::class, 1)->create();
             $cijfer["waarde"] = rand(0, 10);
             $cijfer["toets_id"] = $toetsen[$i]["id"];
             $cijfer["leerling_id"] = $leerlingen[$j]["id"];
             $cijfer->save();
         }
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     Model::reguard();
 }
 public function setUp()
 {
     Eloquent::unguard();
     $db = new DB();
     $db->addConnection(['driver' => 'sqlite', 'database' => ':memory:']);
     $db->bootEloquent();
     $db->setAsGlobal();
     $this->schema()->create('users', function ($table) {
         $table->increments('id');
         $table->string('email');
         $table->string('first_name');
         $table->string('last_name');
         $table->timestamps();
     });
     $this->schema()->create('subscriptions', function ($table) {
         $table->increments('id');
         $table->string('subscription_id');
         $table->string('plan_id');
         $table->integer('user_id')->index()->unsigned();
         $table->integer('quantity')->default(1);
         $table->integer('last_four')->nullable();
         $table->timestamp('ends_at')->nullable();
         $table->timestamp('trial_ends_at')->nullable();
         $table->timestamp('next_billing_at')->nullable();
         $table->timestamps();
     });
     $this->schema()->create('addons', function ($table) {
         $table->increments('id');
         $table->integer('subscription_id')->index()->unsigned();
         $table->string('addon_id');
         $table->integer('quantity')->default(0);
         $table->timestamps();
     });
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(UserTableSeeder::class);
     $this->call(DogTableSeeder::class);
     Model::reguard();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     $this->call(TeamsTableSeeder::class);
     $this->call(TournamentsTableSeeder::class);
     Model::reguard();
 }