Example #1
0
 private function makeTheFirstCustomUser()
 {
     factory(App\Entities\User::class)->create(['username' => 'chuck', 'email' => '*****@*****.**', 'password' => 'ginger', 'level' => 1, 'coins' => 100]);
     $user = User::find(1);
     $user->token = null;
     $user->save();
 }
 /**
  * Creates the application.
  *
  * @return \Illuminate\Foundation\Application
  */
 public function setUp()
 {
     parent::setUp();
     $this->be(User::find(1));
     \DB::connection()->enableQueryLog();
 }
 public function testLocalizationData()
 {
     Session::start();
     $this->be(User::find(1));
     $this->post('/vehicle/dashboard/localization', ['vehicle_id' => 1, "_token" => csrf_token()])->assertResponseStatus(200);
 }
Example #4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // root role
     $root = \Laravolt\Acl\Models\Role::create(['name' => 'root']);
     $admin = \Laravolt\Acl\Models\Role::create(['name' => 'admin']);
     $adminUjiPublik = \Laravolt\Acl\Models\Role::create(['name' => 'admin-uji-publik']);
     // root user
     $user = factory(\App\Entities\User::class)->create(['email' => '*****@*****.**', 'status' => \App\Enum\UserStatus::ACTIVE()]);
     $user->assignRole($root);
     auth()->login($user);
     factory(\App\Entities\User::class, 50)->create();
     $this->command->info('Start Seed Satker, ProgramKerja, and Fase');
     factory(\App\Entities\Satker::class, 10)->create()->each(function ($satker) {
         $proker = factory(\App\Entities\ProgramKerja::class, 10)->create(['satker_id' => $satker->id]);
         $proker->each(function ($proker) {
             $fase = factory(\App\Entities\Fase::class)->create(['type' => \App\Enum\FaseType::PERENCANAAN, 'proker_id' => $proker->id, 'satker_id' => $proker->satker_id]);
             $fase->addDocument(base_path('resources/assets/files/sample.doc'));
             $fase->addDocument(base_path('resources/assets/files/sample.pdf'));
             foreach (range(1, rand(1, 10)) as $id) {
                 Mural::addComment($fase, Faker\Factory::create()->paragraph, 'default');
                 Votee::voteUp($fase, \App\Entities\User::find($id));
                 Votee::voteDown($fase, \App\Entities\User::find($id + 10));
             }
             $fase = factory(\App\Entities\Fase::class, 'berjalan')->create(['type' => \App\Enum\FaseType::PELAKSANAAN, 'proker_id' => $proker->id, 'satker_id' => $proker->satker_id]);
             $fase->addDocument(base_path('resources/assets/files/sample.doc'));
             $fase->addDocument(base_path('resources/assets/files/sample.pdf'));
             foreach (range(1, rand(1, 10)) as $id) {
                 Mural::addComment($fase, Faker\Factory::create()->paragraph, 'default');
                 Votee::voteUp($fase, \App\Entities\User::find($id));
                 Votee::voteDown($fase, \App\Entities\User::find($id + 10));
             }
             $fase = factory(\App\Entities\Fase::class)->create(['type' => \App\Enum\FaseType::PENGAWASAN, 'proker_id' => $proker->id, 'satker_id' => $proker->satker_id]);
             $fase->addDocument(base_path('resources/assets/files/sample.doc'));
             $fase->addDocument(base_path('resources/assets/files/sample.pdf'));
             foreach (range(1, rand(1, 10)) as $id) {
                 Mural::addComment($fase, Faker\Factory::create()->paragraph, 'default');
                 Votee::voteUp($fase, \App\Entities\User::find($id));
                 Votee::voteDown($fase, \App\Entities\User::find($id + 10));
             }
             $proker->current_fase_id = $fase->id;
             $proker->save();
         });
     });
     $this->command->info('Finish Seed Satker, ProgramKerja, and Fase');
     $this->command->info('Start Seed ProgramKerjaUsulan');
     factory(\App\Entities\ProgramKerjaUsulan::class, 50)->create()->each(function ($model) {
         $model->addDocument(base_path('resources/assets/files/sample.doc'));
         $model->addDocument(base_path('resources/assets/files/sample.pdf'));
         foreach (range(1, rand(1, 10)) as $id) {
             Mural::addComment($model, Faker\Factory::create()->paragraph, 'default');
             Votee::voteUp($model, \App\Entities\User::find($id));
             Votee::voteDown($model, \App\Entities\User::find($id + 10));
         }
     });
     $this->command->info('Finish Seed ProgramKerjaUsulan');
     $this->command->info('Start Seed UjiPublik');
     factory(\App\Entities\UjiPublik::class, 50)->create()->each(function ($model) {
         $model->addDocument(base_path('resources/assets/files/sample.doc'));
         $model->addDocument(base_path('resources/assets/files/sample.pdf'));
         foreach (range(1, rand(1, 10)) as $id) {
             Mural::addComment($model, Faker\Factory::create()->paragraph, 'default');
             Votee::voteUp($model, \App\Entities\User::find($id));
             Votee::voteDown($model, \App\Entities\User::find($id + 10));
         }
     });
     $this->command->info('Finish Seed UjiPublik');
     auth()->logout();
     Model::reguard();
 }
 public function setUp()
 {
     parent::setUp();
     Session::start();
     $this->be(User::find(1));
 }
 public function authenticated()
 {
     $user_id = Authorizer::getResourceOwnerId();
     $objUser = User::find($user_id);
     return $objUser;
 }
Example #7
0
 public function actualizarDocente($id, Request $request)
 {
     $cursante = User::find($id);
     //$cursante->fill($request->all());
     $var = $request['profesion'];
     $cursante->id = Input::get('id');
     $cursante->nickname = Input::get('nickname');
     $cursante->password = Input::get('password');
     $cursante->nombres = strtoupper(Input::get('nombres'));
     $cursante->paterno = strtoupper(Input::get('paterno'));
     $cursante->materno = strtoupper(Input::get('materno'));
     $cursante->email = Input::get('email');
     $cursante->telefono = Input::get('telefono');
     $cursante->sexo = Input::get('sexo');
     $cursante->fnac = Input::get('fnac');
     if ($var == 'militar') {
         $cursante->grade_id = Input::get('grade_idm');
     } elseif ($var == 'policia') {
         $cursante->grade_id = Input::get('grade_idp');
     } elseif ($var == 'civil') {
         $cursante->grade_id = Input::get('grade_idc');
     }
     $cursante->direccion = strtoupper(Input::get('direccion'));
     $cursante->profesion = $var;
     $cursante->parentesco = Input::get('parentesco');
     $cursante->nomYap = Input::get('nomYap');
     $cursante->tel = Input::get('tel');
     $cursante->save();
     return redirect('modificarDocente')->with('update', true);
 }