2424use App \MappingMovie ;
2525use App \Http \Requests ;
2626use App \Http \Requests \MappingAddRequest ;
27+ use App \Http \Requests \MappingFindRequest ;
28+ use App \Http \Requests \MappingGetRequest ;
2729
2830
2931class MappingsController extends JSONController
@@ -34,7 +36,7 @@ class MappingsController extends JSONController
3436 * @param int $id
3537 * @return Response
3638 */
37- public function get (Request $ request ) {
39+ public function get (MappingGetRequest $ request ) {
3840 $ id = $ request ->query ("id " );
3941
4042 $ mapping = Mapping::find ($ id );
@@ -47,14 +49,14 @@ public function get(Request $request) {
4749 return response ()->json ($ mapping )->header ("Access-Control-Allow-Origin " , "* " );
4850 }
4951
50- public function find (Request $ request )
52+ public function find (MappingFindRequest $ request )
5153 {
5254 $ tmdbid = $ request ->query ("tmdbid " );
5355 $ movie = MappingMovie::find ($ tmdbid );
5456
5557 if ($ movie == null )
5658 {
57- abort (404 , "Movie with tmdbid $ tmdbid was not found. Either it does not exist or no mappings have been added yet " );
59+ abort (404 , "Movie with tmdbid $ tmdbid was not found. Either it does not exist or no mappings have been added yet. " );
5860 }
5961
6062 $ type = $ request ->query ("type " );
@@ -136,7 +138,7 @@ public function add(MappingAddRequest $request) {
136138 return response ()->json ($ mapping )->header ("Access-Control-Allow-Origin " , "* " );
137139 }
138140
139- public function vote (Request $ request ) {
141+ public function vote (MappingGetRequest $ request ) {
140142 $ id = $ request ->query ("id " );
141143 $ direction = $ request ->query ("direction " );
142144 if (!isset ($ direction ) || $ direction > 1 )
0 commit comments