Skip to content

Commit 201bf7f

Browse files
authored
Merge pull request #58 from Decicus/at/laravel-6-updates
Clean + Upgrade Laravel from 5.8 to 6.x
2 parents 583ea68 + 9829321 commit 201bf7f

15 files changed

Lines changed: 687 additions & 870 deletions

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# For production environments: Recommended to set this to `production`
12
APP_ENV=local
3+
# For production environments: Recommended to set this to `false`
24
APP_DEBUG=true
5+
# Generate a proper one using `php artisan key:generate`
36
APP_KEY=SomeRandomString
47
APP_NAME=DecAPI
58

@@ -16,13 +19,31 @@ REDIS_HOST=127.0.0.1
1619
REDIS_PASSWORD=null
1720
REDIS_PORT=6379
1821

22+
# This project does not use email, AWS or anything like that as of right now.
23+
# These example configuration options are only included in case that changes in the future.
1924
MAIL_DRIVER=smtp
2025
MAIL_HOST=mailtrap.io
2126
MAIL_PORT=2525
2227
MAIL_USERNAME=null
2328
MAIL_PASSWORD=null
2429
MAIL_ENCRYPTION=null
30+
MAIL_FROM_ADDRESS=null
31+
MAIL_FROM_NAME="${APP_NAME}"
2532

33+
AWS_ACCESS_KEY_ID=
34+
AWS_SECRET_ACCESS_KEY=
35+
AWS_DEFAULT_REGION=us-east-1
36+
AWS_BUCKET=
37+
38+
PUSHER_APP_ID=
39+
PUSHER_APP_KEY=
40+
PUSHER_APP_SECRET=
41+
PUSHER_APP_CLUSTER=mt1
42+
43+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
44+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
45+
46+
#### Configure these options to match your setup.
2647
SITE_TITLE="DecAPI"
2748
# "example.com" and all subdomains
2849
SESSION_COOKIE_DOMAIN=".example.com"

app/Console/Commands/RefreshIzurviveLocations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class RefreshIzurviveLocations extends Command
3030
*
3131
* @var string
3232
*/
33-
private $currentMap = 'https://maps.izurvive.com/maps/CH-Sat/1.9.3/citycoords.json';
33+
private $currentMap = 'https://maps.izurvive.com/maps/CH-Sat/1.12.0/citycoords.json';
3434

3535
/**
3636
* Create a new command instance.

app/Http/Controllers/AskfmController.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use App\Http\Requests;
88
use App\Http\Controllers\Controller;
99

10-
use Feed;
10+
use App;
1111
use Carbon\Carbon;
1212

1313
use GuzzleHttp\Client as HttpClient;
@@ -18,8 +18,7 @@ class AskfmController extends Controller
1818
public function rss(Request $request, $user = null)
1919
{
2020
$user = $user ?: $request->input('user', null);
21-
$feed = new Feed;
22-
$feed->setView('vendor.feed.atom');
21+
$feed = App::make('feed');
2322

2423
if (empty($user)) {
2524
$feed->title = 'Ask.fm - RSS Feed';

app/Http/Controllers/DayZController.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use App\Http\Controllers\Controller;
99

1010
use GuzzleHttp\Client;
11-
use Vinelab\Rss\Rss;
1211
use App\Helpers\Helper;
1312
use GameQ\GameQ;
1413
use Log;
@@ -255,22 +254,12 @@ public function statusReport()
255254
/**
256255
* Retrieves the latest DayZ status report posted to Steam news.
257256
*
257+
* ! As of March 2020, this returns the same as /dayz/status-report (dayz.com)
258+
*
258259
* @return Response
259260
*/
260261
public function steamStatusReport()
261262
{
262-
$rss = new Rss();
263-
$feed = $rss->feed('https://steamcommunity.com/games/221100/rss/');
264-
265-
$articles = $feed->articles();
266-
267-
foreach ($articles as $article) {
268-
$title = $article->title;
269-
if (strpos(strtolower($title), 'status report') !== false) {
270-
return Helper::text($title . ' - ' . $article->link);
271-
}
272-
}
273-
274-
return Helper::text('No status reports found.');
263+
return $this->statusReport();
275264
}
276265
}

app/Http/Controllers/LeverController.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,10 @@
66

77
use App\Http\Requests;
88

9-
use Feed;
109
use App\Helpers\Helper;
11-
use GuzzleHttp\Client;
1210

1311
class LeverController extends Controller
1412
{
15-
/**
16-
* Returns an RSS feed of Lever jobs
17-
*
18-
* @param string $title Feed title
19-
* @param string $description Feed description
20-
* @param string $link Feed link
21-
* @param string $logo Feed logo
22-
* @param array $post Array of posts
23-
* @return Response
24-
*/
25-
private function feed($title = 'Lever', $description = 'Lever description', $link = 'https://lever.co/', $logo = '', $posts = [])
26-
{
27-
$feed = new Feed;
28-
$feed->setView('vendor.feed.atom');
29-
$feed->title = $title;
30-
$feed->description = $description;
31-
$feed->link = $link;
32-
$feed->logo = $logo;
33-
$feed->setDateFormat('datetime');
34-
35-
foreach ($posts as $post) {
36-
$date = date('c', $post['timestamp']);
37-
$feed->add($post['text'], $post['guid'], $post['link'], $date, $post['description'], $post['description']);
38-
}
39-
40-
return $feed->render('atom');
41-
}
42-
4313
/**
4414
* Retrieves the Twitch Lever info
4515
*

app/Http/Controllers/Rainbow6Controller.php

Lines changed: 0 additions & 66 deletions
This file was deleted.

app/Http/Controllers/TwitchBlogController.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use App\Http\Requests;
88
use App\Helpers\Helper;
9-
use Vinelab\Rss\Rss;
109

1110
class TwitchBlogController extends Controller
1211
{
@@ -20,21 +19,13 @@ class TwitchBlogController extends Controller
2019
/**
2120
* Retrieves the latest Twitch blog post.
2221
*
22+
* ! Deprecated & removed since the Twitch blog is no longer hosted on Medium.
23+
*
2324
* @param Request $request
2425
* @return Response
2526
*/
2627
public function latest(Request $request)
2728
{
28-
$rss = new Rss;
29-
$feed = $rss->feed($this->baseUrl . '/feed');
30-
31-
$skip = intval($request->input('skip', 0));
32-
33-
$articles = $feed->articles();
34-
35-
$post = $articles[$skip];
36-
$output = sprintf('%s - %s', $post->title, $post->link);
37-
38-
return Helper::text($output);
29+
return Helper::text('410 Gone - This feed (/twitch/blog/latest) has been removed.', 410);
3930
}
4031
}

app/Http/Middleware/RateLimitWithWhitelist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ class RateLimitWithWhitelist extends ThrottleRequests
1616
* @param \Closure $next
1717
* @param int|string $maxAttempts
1818
* @param float|int $decayMinutes
19+
* @param string $prefix
1920
* @return mixed
2021
* @throws \Illuminate\Http\Exceptions\ThrottleRequestsException
2122
*/
22-
public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1)
23+
public function handle($request, Closure $next, $maxAttempts = 60, $decayMinutes = 1, $prefix = '')
2324
{
2425
$apiKey = trim($request->header('x-api-key', ''));
2526
if (empty($apiKey)) {

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
"license": "MIT",
66
"type": "project",
77
"require": {
8-
"php": ">=7.1.3",
9-
"laravel/framework": "5.8.*",
8+
"php": ">=7.2.0",
9+
"laravel/framework": "^6.0",
1010
"guzzlehttp/guzzle": "^6.1",
11-
"roumen/feed": "^2.10",
1211
"paquettg/php-html-parser": "^1.6",
1312
"symfony/dom-crawler": "~4.0",
1413
"symfony/css-selector": "~4.0",
15-
"vinelab/rss": "^1.0",
1614
"austinb/gameq": "3.*@dev",
1715
"thujohn/twitter": "^2.2",
1816
"alaouy/youtube": "^1.2",
@@ -24,8 +22,9 @@
2422
"ramsey/uuid": "^3.7",
2523
"predis/predis": "^1.1",
2624
"laravel/tinker": "^1.0",
27-
"laravel/helpers": "^1.0",
28-
"chaseconey/laravel-datadog-helper": "^1.1"
25+
"laravel/helpers": "^1.2",
26+
"chaseconey/laravel-datadog-helper": "^1.1",
27+
"laravelium/feed": "6.0.*"
2928
},
3029
"require-dev": {
3130
"fzaninotto/faker": "~1.4",

0 commit comments

Comments
 (0)