예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data['districts'] = District::all();
     $data['importbtn'] = Permission::hasPermission('districts.import');
     $data['deletebtn'] = Permission::hasPermission('districts.delete');
     return view('districts.index', $data);
 }
예제 #2
0
 public function anyData()
 {
     $datas = District::all();
     if ($datas) {
         foreach ($datas as &$data) {
             $url_edit = route('district.edit', $data['id']);
             $data['buttons'] = '<div class="btn-group">';
             $data['buttons'] .= '<a href="' . $url_edit . '" class="btn btn-default edit" title="Edit"><i class="fa fa-edit"></i></a>';
             $data['buttons'] .= '<a href="#self" class="btn btn-default delete" title="Delete" data-id="' . $data['id'] . '"><i class="fa fa-remove"></i></a>';
             $data['buttons'] .= '</div>';
         }
         return Datatables::of($datas)->make(true);
     } else {
         return $this->notFoundResponse();
     }
 }
예제 #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function getEdit($id)
 {
     $this->districts = District::all('id', 'name');
     $street = Street::find($id);
     if ($street) {
         return view('modules.street.form', array('is_edit' => true, 'street' => $street, 'districts' => $this->districts));
     } else {
         return $this->notFoundResponse();
     }
 }
예제 #4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function getEdit($id)
 {
     $this->districts = District::all('id', 'name');
     $area = Area::find($id);
     if ($area) {
         return view('modules.area.form', array('is_edit' => true, 'area' => $area, 'districts' => $this->districts));
     } else {
         return $this->notFoundResponse();
     }
 }
예제 #5
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return District::all();
 }