Beispiel #1
0
 public static function createDrill($data)
 {
     $drill = new Drill();
     $drill->title = $data['title'];
     $drill->description = $data['description'];
     $drill->media = $data['media'];
     $drill->instructions = $data['instructions'];
     $drill->coaching_points = $data['coaching_points'];
     //$drill->access = $data['private'];
     //$drill->user =
     $drill->save();
     return $drill;
 }
 public function clearAll()
 {
     $users = User::all();
     foreach ($users as $u) {
         $u->delete();
     }
     $drills = Drill::all();
     foreach ($drills as $d) {
         $d->delete();
     }
     $games = Game::all();
     foreach ($games as $g) {
         $g->delete();
     }
     $clubs = Club::all();
     foreach ($clubs as $c) {
         $c->delete();
     }
 }
 public function store(Request $request)
 {
     //
     $drill = Drill::createDrill(Input::all());
     return response()->json($drill, 200);
 }