@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class HistoryController extends Controller |
10 | 10 | { |
11 | - public function index($id){ |
|
11 | + public function index($id) { |
|
12 | 12 | $a = Activity::all()->where('subject_type', '=', 'App\Models\Game') |
13 | 13 | ->where('subject_id', '=', $id); |
14 | 14 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | class SitemapController extends Controller |
14 | 14 | { |
15 | - public function index(){ |
|
15 | + public function index() { |
|
16 | 16 | Sitemap::addSitemap(route('sitemap.users')); |
17 | 17 | Sitemap::addSitemap(route('sitemap.games')); |
18 | 18 | Sitemap::addSitemap(route('sitemap.developer')); |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | return Sitemap::index(); |
23 | 23 | } |
24 | 24 | |
25 | - Public function users(){ |
|
25 | + Public function users() { |
|
26 | 26 | $users = User::all(); |
27 | 27 | |
28 | - foreach ($users as $user){ |
|
28 | + foreach ($users as $user) { |
|
29 | 29 | Sitemap::addTag(route('users.show', $user->id), $user->created_at, 'monthly', '0.8'); |
30 | 30 | } |
31 | 31 | |
32 | 32 | return Sitemap::render(); |
33 | 33 | } |
34 | 34 | |
35 | - public function games(){ |
|
35 | + public function games() { |
|
36 | 36 | $games = \DB::table('games') |
37 | 37 | ->leftJoin('screenshots', 'games.id', '=', 'screenshots.game_id') |
38 | 38 | ->where('screenshots.screenshot_id', '=', 1) |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | return Sitemap::render(); |
47 | 47 | } |
48 | 48 | |
49 | - public function developer(){ |
|
49 | + public function developer() { |
|
50 | 50 | $dev = Developer::all(); |
51 | 51 | |
52 | 52 | foreach ($dev as $d) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return Sitemap::render(); |
57 | 57 | } |
58 | 58 | |
59 | - public function board(){ |
|
59 | + public function board() { |
|
60 | 60 | $threads = BoardThread::all(); |
61 | 61 | |
62 | 62 | foreach ($threads as $thread) { |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | |
67 | 67 | } |
68 | 68 | |
69 | - public function news(){ |
|
69 | + public function news() { |
|
70 | 70 | $news = News::all()->where('approved', '=', 1); |
71 | 71 | |
72 | 72 | foreach ($news as $new) { |
73 | - Sitemap::addTag(url('news', $new->id), $new->created_at, 'monthly' ,'0.8'); |
|
73 | + Sitemap::addTag(url('news', $new->id), $new->created_at, 'monthly', '0.8'); |
|
74 | 74 | } |
75 | 75 | return Sitemap::render(); |
76 | 76 |
@@ -10,15 +10,15 @@ discard block |
||
10 | 10 | class LogoController extends Controller |
11 | 11 | { |
12 | 12 | |
13 | - public function vote_get(){ |
|
13 | + public function vote_get() { |
|
14 | 14 | $logos = array(); |
15 | 15 | |
16 | - if(\Auth::check()){ |
|
16 | + if (\Auth::check()) { |
|
17 | 17 | $logos = \DB::table('logos') |
18 | 18 | ->leftJoin('logo_votes', 'logos.id', '=', 'logo_votes.logo_id') |
19 | 19 | ->leftJoin('users', 'logos.user_id', '=', 'users.id') |
20 | 20 | ->select(['logos.id', 'logos.filename', 'logos.title', 'users.name', 'logos.user_id']) |
21 | - ->whereNotExists(function($query){ |
|
21 | + ->whereNotExists(function($query) { |
|
22 | 22 | $query->select(\DB::raw(1)) |
23 | 23 | ->from('logo_votes') |
24 | 24 | ->whereRaw('logo_votes.logo_id = logos.id') |
@@ -31,15 +31,15 @@ discard block |
||
31 | 31 | return view('logo.index', ['logo' => $logos]); |
32 | 32 | } |
33 | 33 | |
34 | - public function vote_add($id, Request $request){ |
|
34 | + public function vote_add($id, Request $request) { |
|
35 | 35 | |
36 | 36 | $lv = new LogoVote; |
37 | 37 | $lv->logo_id = $id; |
38 | 38 | $lv->user_id = \Auth::id(); |
39 | - if($request->get('value') == 0){ |
|
39 | + if ($request->get('value') == 0) { |
|
40 | 40 | $lv->down = 1; |
41 | 41 | $lv->up = 0; |
42 | - }else{ |
|
42 | + }else { |
|
43 | 43 | $lv->down = 0; |
44 | 44 | $lv->up = 1; |
45 | 45 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if($request->get('value') == 0){ |
40 | 40 | $lv->down = 1; |
41 | 41 | $lv->up = 0; |
42 | - }else{ |
|
42 | + } else{ |
|
43 | 43 | $lv->down = 0; |
44 | 44 | $lv->up = 1; |
45 | 45 | } |
@@ -12,15 +12,15 @@ |
||
12 | 12 | return view('auth.settings'); |
13 | 13 | } |
14 | 14 | |
15 | - public function store_password(Request $request){ |
|
15 | + public function store_password(Request $request) { |
|
16 | 16 | $this->validate($request, [ |
17 | 17 | 'passwordold' => 'required', |
18 | 18 | 'password1' => 'required', |
19 | 19 | 'password2' => 'required' |
20 | 20 | ]); |
21 | 21 | |
22 | - if($request->get('password1') == $request->get('password2')){ |
|
23 | - if(\Hash::check($request->get('passwordold'), \Auth::user()->password)){ |
|
22 | + if ($request->get('password1') == $request->get('password2')) { |
|
23 | + if (\Hash::check($request->get('passwordold'), \Auth::user()->password)) { |
|
24 | 24 | $user = \Auth::user(); |
25 | 25 | $user->password = \Hash::make($request->get('password1')); |
26 | 26 | $user->save(); |
@@ -15,13 +15,13 @@ |
||
15 | 15 | |
16 | 16 | class FineUploaderController extends Controller |
17 | 17 | { |
18 | - public function endpoint(Request $request){ |
|
18 | + public function endpoint(Request $request) { |
|
19 | 19 | $fu = new FineUploader(); |
20 | 20 | $destpath = storage_path('app/public/temp'); |
21 | - if(!file_exists($destpath)){ |
|
21 | + if (!file_exists($destpath)) { |
|
22 | 22 | mkdir($destpath); |
23 | 23 | } |
24 | - $res = $fu->handleUpload(storage_path('app/public/temp'),'file'); |
|
24 | + $res = $fu->handleUpload(storage_path('app/public/temp'), 'file'); |
|
25 | 25 | |
26 | 26 | $res['ext'] = pathinfo($fu->getName(), PATHINFO_EXTENSION); |
27 | 27 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class AwardController extends Controller |
9 | 9 | { |
10 | - public function index(){ |
|
10 | + public function index() { |
|
11 | 11 | |
12 | 12 | $awards = \DB::table('award_cats') |
13 | 13 | ->leftJoin('award_pages', 'award_cats.award_page_id', '=', 'award_pages.id') |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | ]); |
28 | 28 | } |
29 | 29 | |
30 | - public function show($awardid){ |
|
30 | + public function show($awardid) { |
|
31 | 31 | $award = \DB::table('award_cats') |
32 | 32 | ->leftJoin('award_pages', 'award_pages.id', '=', 'award_cats.award_page_id') |
33 | 33 | ->select([ |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ->select('id', 'title', 'short') |
84 | 84 | ->get(); |
85 | 85 | $gtypes = array(); |
86 | - foreach ($gametypes as $gt){ |
|
86 | + foreach ($gametypes as $gt) { |
|
87 | 87 | $t['title'] = $gt->title; |
88 | 88 | $t['short'] = $gt->short; |
89 | 89 | $gtypes[$gt->id] = $t; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | ]); |
106 | 106 | } |
107 | 107 | |
108 | - public function create(){ |
|
108 | + public function create() { |
|
109 | 109 | $pages = \DB::table('award_pages') |
110 | 110 | ->orderBy('title') |
111 | 111 | ->get(); |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | ]); |
132 | 132 | } |
133 | 133 | |
134 | - public function gameadd($subcatid){ |
|
134 | + public function gameadd($subcatid) { |
|
135 | 135 | return view('awards.gameadd', [ |
136 | 136 | 'subcatid' => $subcatid, |
137 | 137 | ]); |
138 | 138 | } |
139 | 139 | |
140 | - public function gameadd_store(Request $request){ |
|
140 | + public function gameadd_store(Request $request) { |
|
141 | 141 | $this->validate($request, [ |
142 | 142 | 'game' => 'required|numeric', |
143 | 143 | 'place' => 'required|numeric', |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | //dd($check); |
157 | 157 | |
158 | - if($check->count() == 0){ |
|
158 | + if ($check->count() == 0) { |
|
159 | 159 | \DB::table('games_awards')->insert([ |
160 | 160 | 'game_id' => $request->get('game'), |
161 | 161 | 'developer_id' => 0, |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | } |
175 | 175 | |
176 | - public function store_page(Request $request){ |
|
176 | + public function store_page(Request $request) { |
|
177 | 177 | $this->validate($request, [ |
178 | 178 | 'awardpage' => 'required', |
179 | 179 | ]); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | ->where('title', '=', $request->get('awardpage')) |
183 | 183 | ->get(); |
184 | 184 | |
185 | - if($check->count() == 0){ |
|
185 | + if ($check->count() == 0) { |
|
186 | 186 | \DB::table('award_pages')->insert([ |
187 | 187 | 'title' => $request->get('awardpage'), |
188 | 188 | 'website_url' => $request->get('awardpageurl'), |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | return redirect()->action('AwardController@create'); |
195 | 195 | } |
196 | 196 | |
197 | - public function store_cat(Request $request){ |
|
197 | + public function store_cat(Request $request) { |
|
198 | 198 | $this->validate($request, [ |
199 | 199 | 'awardpage' => 'required|not_in:0', |
200 | 200 | 'awardname' => 'required', |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | ->where('award_page_id', '=', $request->get('awardpage')) |
209 | 209 | ->get(); |
210 | 210 | |
211 | - if($check->count() == 0){ |
|
211 | + if ($check->count() == 0) { |
|
212 | 212 | \DB::table('award_cats')->insert([ |
213 | 213 | 'title' => $request->get('awardname'), |
214 | 214 | 'award_page_id' => $request->get('awardpage'), |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | return redirect()->action('AwardController@create'); |
223 | 223 | } |
224 | 224 | |
225 | - public function store_subcat(Request $request){ |
|
225 | + public function store_subcat(Request $request) { |
|
226 | 226 | $this->validate($request, [ |
227 | 227 | 'award' => 'required|not_in:0', |
228 | 228 | 'awardsubcat' => 'required', |
229 | 229 | ]); |
230 | 230 | |
231 | - $aw = explode('-',$request->get('award')); |
|
231 | + $aw = explode('-', $request->get('award')); |
|
232 | 232 | |
233 | 233 | $check = \DB::table('award_subcats') |
234 | 234 | ->where('cat_id', '=', $aw[1]) |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | ->where('title', '=', $request->get('awardsubcat')) |
237 | 237 | ->get(); |
238 | 238 | |
239 | - if($check->count() == 0){ |
|
239 | + if ($check->count() == 0) { |
|
240 | 240 | \DB::table('award_subcats')->insert([ |
241 | 241 | 'title' => $request->get('awardsubcat'), |
242 | 242 | 'created_at' => Carbon::now(), |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | |
8 | 8 | class SearchController extends Controller |
9 | 9 | { |
10 | - public function index(){ |
|
10 | + public function index() { |
|
11 | 11 | return view('search.index'); |
12 | 12 | } |
13 | 13 | |
14 | - public function search(Request $request){ |
|
14 | + public function search(Request $request) { |
|
15 | 15 | $games = \DB::table('games') |
16 | 16 | ->leftJoin('games_developer', 'games.id', '=', 'games_developer.game_id') |
17 | 17 | ->leftJoin('developer', 'games_developer.developer_id', '=', 'developer.id') |
18 | 18 | ->leftJoin('makers', 'makers.id', '=', 'games.maker_id') |
19 | - ->leftJoin('comments', function($join){ |
|
19 | + ->leftJoin('comments', function($join) { |
|
20 | 20 | $join->on('comments.content_id', '=', 'games.id'); |
21 | 21 | $join->on('comments.content_type', '=', \DB::raw("'game'")); |
22 | 22 | }) |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ->select('id', 'title', 'short') |
54 | 54 | ->get(); |
55 | 55 | $gtypes = array(); |
56 | - foreach ($gametypes as $gt){ |
|
56 | + foreach ($gametypes as $gt) { |
|
57 | 57 | $t['title'] = $gt->title; |
58 | 58 | $t['short'] = $gt->short; |
59 | 59 | $gtypes[$gt->id] = $t; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | class MessagesController extends Controller |
16 | 16 | { |
17 | - public function index(){ |
|
17 | + public function index() { |
|
18 | 18 | $currentUserId = \Auth::id(); |
19 | 19 | |
20 | 20 | //Alle threads laden, abgesehen von gelöscht und archivierten empfängern |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | return view('messenger.index', compact('threads', 'currentUserId', 'users')); |
31 | 31 | } |
32 | 32 | |
33 | - public function create(){ |
|
33 | + public function create() { |
|
34 | 34 | $users = User::where('id', '!=', \Auth::id())->get(); |
35 | 35 | return view('messenger.create', compact('users')); |
36 | 36 | } |
37 | 37 | |
38 | - public function store(){ |
|
38 | + public function store() { |
|
39 | 39 | $input = Input::get(); |
40 | 40 | $thread = Thread::create( |
41 | 41 | [ |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | return redirect('messages'); |
66 | 66 | } |
67 | 67 | |
68 | - public function show($id){ |
|
68 | + public function show($id) { |
|
69 | 69 | try { |
70 | 70 | $thread = Thread::findOrFail($id); |
71 | 71 | } catch (ModelNotFoundException $e) { |
72 | - Session::flash('error_message', 'The thread with ID: ' . $id . ' was not found.'); |
|
72 | + Session::flash('error_message', 'The thread with ID: '.$id.' was not found.'); |
|
73 | 73 | return redirect('messages'); |
74 | 74 | } |
75 | 75 | // show current user in list if not a current participant |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | return view('messenger.show', compact('thread', 'users')); |
82 | 82 | } |
83 | 83 | |
84 | - public function update($id){ |
|
84 | + public function update($id) { |
|
85 | 85 | try { |
86 | 86 | $thread = Thread::findOrFail($id); |
87 | 87 | } catch (ModelNotFoundException $e) { |
88 | - Session::flash('error_message', 'The thread with ID: ' . $id . ' was not found.'); |
|
88 | + Session::flash('error_message', 'The thread with ID: '.$id.' was not found.'); |
|
89 | 89 | return redirect('messages'); |
90 | 90 | } |
91 | 91 | $thread->activateAllParticipants(); |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | if (Input::has('recipients')) { |
111 | 111 | $thread->addParticipant(Input::get('recipients')); |
112 | 112 | } |
113 | - return redirect('messages/' . $id); |
|
113 | + return redirect('messages/'.$id); |
|
114 | 114 | } |
115 | 115 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | class CommentController extends Controller |
12 | 12 | { |
13 | - public function add(Request $request){ |
|
13 | + public function add(Request $request) { |
|
14 | 14 | $comment = new Comment; |
15 | 15 | |
16 | 16 | $comment->user_id = \Auth::id(); |
@@ -21,15 +21,15 @@ discard block |
||
21 | 21 | |
22 | 22 | $rate = $request->get('rating'); |
23 | 23 | |
24 | - if($rate == 'up'){ |
|
24 | + if ($rate == 'up') { |
|
25 | 25 | $comment->vote_up = 1; |
26 | 26 | $comment->vote_down = 0; |
27 | 27 | event(new Obyx('rating', \Auth::id())); |
28 | - }elseif($rate == 'down'){ |
|
28 | + }elseif ($rate == 'down') { |
|
29 | 29 | $comment->vote_up = 0; |
30 | 30 | $comment->vote_down = 1; |
31 | 31 | event(new Obyx('rating', \Auth::id())); |
32 | - }else{ |
|
32 | + }else { |
|
33 | 33 | $comment->vote_up = 0; |
34 | 34 | $comment->vote_down = 0; |
35 | 35 | } |
@@ -39,6 +39,6 @@ discard block |
||
39 | 39 | event(new Obyx('comment', \Auth::id())); |
40 | 40 | |
41 | 41 | |
42 | - return redirect()->action('MsgBoxController@comment_add', [$request->get('content_type') ,$request->get('content_id')]); |
|
42 | + return redirect()->action('MsgBoxController@comment_add', [$request->get('content_type'), $request->get('content_id')]); |
|
43 | 43 | } |
44 | 44 | } |
@@ -25,11 +25,11 @@ |
||
25 | 25 | $comment->vote_up = 1; |
26 | 26 | $comment->vote_down = 0; |
27 | 27 | event(new Obyx('rating', \Auth::id())); |
28 | - }elseif($rate == 'down'){ |
|
28 | + } elseif($rate == 'down'){ |
|
29 | 29 | $comment->vote_up = 0; |
30 | 30 | $comment->vote_down = 1; |
31 | 31 | event(new Obyx('rating', \Auth::id())); |
32 | - }else{ |
|
32 | + } else{ |
|
33 | 33 | $comment->vote_up = 0; |
34 | 34 | $comment->vote_down = 0; |
35 | 35 | } |