Esempio n. 1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //bhs inggris
     $check_mapel = Mapel::where('nama', '=', 'Bhs Inggris')->first();
     if (count($check_mapel) <= 0) {
         $data = ['nama' => 'Bhs Inggris'];
         $insert_mapel = Mapel::create($data);
     }
     //bhs indonesia
     $check_mapel = Mapel::where('nama', '=', 'Bhs Indonesia')->first();
     if (count($check_mapel) <= 0) {
         $data = ['nama' => 'Bhs Indonesia'];
         $insert_mapel = Mapel::create($data);
     }
     //matematika
     $check_mapel = Mapel::where('nama', '=', 'Matematika')->first();
     if (count($check_mapel) <= 0) {
         $data = ['nama' => 'Matematika'];
         $insert_mapel = Mapel::create($data);
     }
 }
Esempio n. 2
0
 /**
  * GET halaman untuk edit data kelas
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function edit($id)
 {
     $q_mapel = Mapel::all();
     $mapel = $this->fungsi->get_dropdown($q_mapel, 'mata pelajaran');
     $kelas = $this->kelas->findOrFail($id);
     $vars = compact('kelas', 'mapel');
     return view($this->base_view . 'popup.edit', $vars);
 }