Esempio n. 1
0
 public function getEditable($decleration_id, $field_name)
 {
     if (!Auth::user() || Auth::user()->role == 100) {
         Redirect::to('/')->send();
     }
     $editable = Editable::checkIfEditable($decleration_id, $field_name);
     if ($editable) {
         Editable::deleteEditable($decleration_id, $field_name);
     } else {
         Editable::create(['decleration_id' => $decleration_id, 'field_name' => $field_name]);
     }
     return Redirect::Back();
 }
Esempio n. 2
0
 public static function deleteEditable($decleration_id, $field_name)
 {
     return Editable::where('decleration_id', $decleration_id)->where('field_name', $field_name)->delete();
 }