コード例 #1
0
 public function store(Request $request)
 {
     if (SemesterEventType::where('name', $request->name)->count()) {
         return redirect()->route('ac.semestereventtypes.index')->with('warning', 'لا يمكن تسمية نفس الاسم');
     }
     $type = new SemesterEventType();
     $type->fill($request->all());
     $type->save();
     if ($request->input('submit') == 'save') {
         return redirect()->back()->with('success');
     }
     return redirect()->route('ac.semestereventtypes.index');
 }
コード例 #2
0
 public function delete(SEtype $SEtypes, $tid)
 {
     $SEtype = $SEtypes->where("id", $tid)->first();
     $SEtype->delete();
     return redirect()->route('ac.semestereventtypes.index');
 }