예제 #1
0
 public function save()
 {
     $adminId = Session::get('admin_id');
     if (!isset($adminId)) {
         return json_encode(array('message' => 'not logged'));
     }
     $courier = new Courier();
     $courier->name = Input::get('name');
     $courier->contact_person = Input::get('contact_person');
     $courier->address = Input::get('address');
     $courier->location_id = Input::get('city');
     $courier->country = 'India';
     $courier->land_mark = Input::get('land_mark');
     $courier->zip = Input::get('zip');
     $courier->contact_number_1 = Input::get('contact_number_1');
     $courier->contact_number_2 = Input::get('contact_number_2');
     $courier->email = Input::get('email');
     $courier->status = 'active';
     $courier->created_at = date('Y-m-d h:i:s');
     $courier->save();
     return json_encode(array('message' => 'done'));
 }