コード例 #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $jabatan = Jabatan::find($id);
     if ($jabatan->delete()) {
         return Response::json(array('success' => TRUE));
     }
 }
コード例 #2
0
 /**
  * The attributes excluded from the model's JSON form.
  *
  * @var array
  */
 public function getNamaJabatanAttribute()
 {
     $name = $this->attributes['id_jabatan'];
     $data = Jabatan::find($name);
     if ($data) {
         return $data->nama_jabatan;
     }
     return '-';
 }
コード例 #3
0
 /**
  * Show the form for editing the specified jabatan.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $jabatan = Jabatan::find($id);
     return View::make('jabatans.edit', ['jabatan' => $jabatan])->withTitle("Ubah {$jabatan->nama}");
 }