public function info_game($id) { $games = new GiantBombApi(); $gameInfo = $games->getAllGameInfoById($id); $gameDesc = preg_replace("/<img[^>]+\\>/i", "", str_replace('href="', 'target="_blank" href="http://giantbomb.com', $gameInfo['description'])); // return view('pages.info_game', compact('tweetV', 'tweetR', 'tweetJ', 'gameInfo', 'gameDesc')); }
public function test() { $games = new GiantBombApi(); $gamesArray = $games->getAllGameInfoById(46090); $tweetV = \App\Tweet::getStatusVlambeer(); $tweetR = \App\Tweet::getStatusRami(); $tweetJ = \App\Tweet::getStatusJan(); return view('pages.giantbomb_api', compact('gamesArray', 'tweetV', 'tweetR', 'tweetJ')); }
/** * Store a newly created resource in storage. * * @return \Illuminate\Http\Response * * @param \App\Http\Requests\GameCreateRequest $request * * GameCreateRequest -> Validator * * Usage of GiantBombApi to get the name */ public function store(GameCreateRequest $request, Game $game) { $games = new GiantBombApi(); $game->id = $request->input('id'); $game->game_name = $games->getGameNameFromApi($request->input('id'))['name']; // if($request->hasFile('game_background_video')){ // $game->game_background_video = $request->file('game_background_video')->getClientOriginalName(); //// dd($request->file('game_background_video')->getFilename()); // $fileNew = $request->file('game_background_video')->getFilename(); // $fileOld = $request->file('game_background_video')->getClientOriginalName(); // Storage::disk('local')->put($fileOld, $fileNew); // // } $game->game_background_video = $request->input('game_background_video'); // dd($game->game_background_video); $game->game_background_img = $request->input('game_background_img'); $game->custom_payment_link = $request->input('custom_payment_link'); $game->steam_payment_link = $request->input('steam_payment_link'); $game->ios_payment_link = $request->input('ios_payment_link'); $game->psn_payment_link = $request->input('psn_payment_link'); $game->android_payment_link = $request->input('android_payment_link'); $game->save(); return redirect('/admin/games')->with('message', 'Successfully created a new game'); }
public function category($cat) { if ($cat == 'sales') { $productArray = \App\Product::where('sale', 1)->get(); } else { $productArray = \App\Product::where('category', $cat)->get(); } $games = new GiantBombApi(); $gameInfo = $games->getAllGameInfoById(34402); $productimg = Product::query()->orderByRaw("RAND()")->limit(5)->get(); $product_sale_img = Product::query()->where('sale', 1)->get(); return view('shop.index', compact('gameInfo', 'productArray', 'productimg', 'product_sale_img')); }