@@ 10-76 (lines=67) @@ | ||
7 | ||
8 | use Illuminate\Http\Request; |
|
9 | ||
10 | class EboardController extends Controller { |
|
11 | ||
12 | public function __construct() |
|
13 | { |
|
14 | $this->middleware('auth'); |
|
15 | $this->middleware('editor'); |
|
16 | } |
|
17 | ||
18 | /** |
|
19 | * Display a listing of the resource. |
|
20 | * |
|
21 | * @return Response |
|
22 | */ |
|
23 | public function index() |
|
24 | { |
|
25 | $eboard = Eboard::orderBy('position', 'asc')->get(); |
|
26 | return view('admin.eboard.index', ['eboard' => $eboard]); |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * Display a listing of the resource. |
|
31 | * |
|
32 | * @return Response |
|
33 | */ |
|
34 | public function new_position() |
|
35 | { |
|
36 | return view('admin.eboard.create'); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * Save the new eboard position. |
|
41 | * |
|
42 | *@return Response |
|
43 | */ |
|
44 | public function create(Requests\CreateRequest $request) |
|
45 | { |
|
46 | $input = $request->all(); |
|
47 | $position = new Eboard($input); |
|
48 | $position->save(); |
|
49 | return redirect()->route('admin.eboard.index') |
|
50 | ->with('success', 'Position Saved!'); |
|
51 | } |
|
52 | ||
53 | public function edit($id) |
|
54 | { |
|
55 | $position = Eboard::findOrFail($id); |
|
56 | ||
57 | return view('admin.eboard.edit', ['eboard' => $position]); |
|
58 | } |
|
59 | ||
60 | public function update(Requests\UpdateRequest $request, $id) |
|
61 | { |
|
62 | $position = Eboard::findOrFail($id); |
|
63 | $position->fill($request->all()); |
|
64 | $position->save(); |
|
65 | return redirect()->route('admin.eboard.index') |
|
66 | ->with('success', 'Position Saved!'); |
|
67 | } |
|
68 | ||
69 | public function delete($id) |
|
70 | { |
|
71 | Eboard::destroy($id); |
|
72 | return redirect()->route('admin.eboard.index') |
|
73 | ->with('success', 'Position Deleted!'); |
|
74 | } |
|
75 | ||
76 | } |
|
77 |
@@ 10-76 (lines=67) @@ | ||
7 | ||
8 | use Illuminate\Http\Request; |
|
9 | ||
10 | class VideoController extends Controller { |
|
11 | ||
12 | public function __construct() |
|
13 | { |
|
14 | $this->middleware('auth'); |
|
15 | $this->middleware('editor'); |
|
16 | } |
|
17 | ||
18 | /** |
|
19 | * Display a listing of the Videos. |
|
20 | * |
|
21 | * @return Response |
|
22 | */ |
|
23 | public function index() |
|
24 | { |
|
25 | $videos = Video::orderBy('artist', 'asc')->get(); |
|
26 | return view('admin.videos.index', ['videos' => $videos]); |
|
27 | } |
|
28 | ||
29 | /** |
|
30 | * Display a listing of the resource. |
|
31 | * |
|
32 | * @return Response |
|
33 | */ |
|
34 | public function new_review() |
|
35 | { |
|
36 | return view('admin.videos.create'); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * Save the new eboard position. |
|
41 | * |
|
42 | *@return Response |
|
43 | */ |
|
44 | public function create(Requests\CreateRequest $request) |
|
45 | { |
|
46 | $input = $request->all(); |
|
47 | $video = new Video($input); |
|
48 | $video->save(); |
|
49 | return redirect()->route('admin.videos.index') |
|
50 | ->with('success', 'Video Review Saved!'); |
|
51 | } |
|
52 | ||
53 | public function edit($id) |
|
54 | { |
|
55 | $video = Video::findOrFail($id); |
|
56 | ||
57 | return view('admin.videos.edit', ['video' => $video]); |
|
58 | } |
|
59 | ||
60 | public function update(Requests\UpdateRequest $request, $id) |
|
61 | { |
|
62 | $video = Video::findOrFail($id); |
|
63 | $video->fill($request->all()); |
|
64 | $video->save(); |
|
65 | return redirect()->route('admin.videos.index') |
|
66 | ->with('success', 'Video Review Saved!'); |
|
67 | } |
|
68 | ||
69 | public function delete($id) |
|
70 | { |
|
71 | Video::destroy($id); |
|
72 | return redirect()->route('admin.videos.index') |
|
73 | ->with('success', 'Video Review Deleted!'); |
|
74 | } |
|
75 | ||
76 | } |
|
77 |