コード例 #1
0
 public function ekspedisi()
 {
     $term = Input::get('term');
     $data = Ekspedisi::distinct()->select('nama', 'id')->where('nama', 'LIKE', '%' . $term . '%')->groupBy('id')->take(15)->get();
     $result = [];
     foreach ($data as $eks) {
         if (strpos(Str::lower($eks), $term) !== false) {
             $result[] = ['value' => $eks->nama];
         }
     }
     return Response::json($result);
 }
コード例 #2
0
 /**
  * Remove the specified ekspedisi from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Ekspedisi::destroy($id);
     return Redirect::route('ekspedisis.index');
 }