Skip to content

Commit 73f0e68

Browse files
committed
update to laravel 6.8
1 parent fcf629f commit 73f0e68

20 files changed

+494
-246
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Homestead.json
55
Homestead.yaml
66
/backend/.env
77
/bin/.worker.pid
8+
/backend/.phpunit.result.cache
89

910
*/.DS_Store
1011
/public/assets/app.css

backend/app/Http/Controllers/ExportImportController.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use App\Services\Storage;
1111
use App\Setting;
1212
use Illuminate\Support\Facades\DB;
13-
use Illuminate\Support\Facades\Input;
13+
use Illuminate\Support\Facades\Request;
1414
use Symfony\Component\HttpFoundation\Response;
1515

1616
class ExportImportController {
@@ -52,14 +52,14 @@ public function export()
5252
/**
5353
* Reset item table and restore backup.
5454
* Downloads every poster image new.
55-
*
55+
*
5656
* @return Response
5757
*/
5858
public function import()
5959
{
6060
increaseTimeLimit();
6161

62-
$file = Input::file('import');
62+
$file = Request::file('import');
6363

6464
$extension = $file->getClientOriginalExtension();
6565

@@ -86,33 +86,33 @@ private function importItems($data)
8686
ImportItem::dispatch(json_encode($item));
8787
}
8888
}
89-
89+
9090
logInfo("Import Movies done.");
9191
}
9292

9393
private function importEpisodes($data)
9494
{
9595
logInfo("Import Tv Shows");
96-
96+
9797
if(isset($data->episodes)) {
9898
$this->episodes->truncate();
99-
99+
100100
foreach(array_chunk($data->episodes, 50) as $chunk) {
101101
ImportEpisode::dispatch(json_encode($chunk));
102102
}
103103
}
104-
104+
105105
logInfo("Import Tv Shows done.");
106106
}
107107

108108
private function importAlternativeTitles($data)
109109
{
110110
if(isset($data->alternative_titles)) {
111111
$this->alternativeTitles->truncate();
112-
112+
113113
foreach($data->alternative_titles as $title) {
114114
$title = collect($title)->except('id')->toArray();
115-
115+
116116
$this->alternativeTitles->create($title);
117117
}
118118
}
@@ -121,12 +121,12 @@ private function importAlternativeTitles($data)
121121
private function importSettings($data)
122122
{
123123
if(isset($data->settings)) {
124-
124+
125125
$this->settings->truncate();
126-
126+
127127
foreach($data->settings as $setting) {
128128
$setting = collect($setting)->except('id')->toArray();
129-
129+
130130
$this->settings->create($setting);
131131
}
132132
}

backend/app/Http/Controllers/ItemController.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use App\Services\Models\AlternativeTitleService;
66
use App\Services\Models\EpisodeService;
77
use App\Services\Models\ItemService;
8-
use Illuminate\Support\Facades\Input;
8+
use Illuminate\Support\Facades\Request;
99
use Symfony\Component\HttpFoundation\Response;
1010

1111
class ItemController {
@@ -31,17 +31,17 @@ public function episodes($tmdbId)
3131

3232
public function search()
3333
{
34-
return $this->itemService->search(Input::get('q'));
34+
return $this->itemService->search(Request::input('q'));
3535
}
3636

3737
public function changeRating($itemId)
3838
{
39-
return $this->itemService->changeRating($itemId, Input::get('rating'));
39+
return $this->itemService->changeRating($itemId, Request::input('rating'));
4040
}
4141

4242
public function add()
4343
{
44-
return $this->itemService->create(Input::get('item'));
44+
return $this->itemService->create(Request::input('item'));
4545
}
4646

4747
public function watchlist()
@@ -61,7 +61,7 @@ public function remove($itemId)
6161
public function refresh($itemId)
6262
{
6363
$this->itemService->refresh($itemId);
64-
64+
6565
return response([], Response::HTTP_OK);
6666
}
6767

@@ -88,9 +88,9 @@ public function toggleEpisode($id)
8888

8989
public function toggleSeason()
9090
{
91-
$tmdbId = Input::get('tmdb_id');
92-
$season = Input::get('season');
93-
$seen = Input::get('seen');
91+
$tmdbId = Request::input('tmdb_id');
92+
$season = Request::input('season');
93+
$seen = Request::input('seen');
9494

9595
$this->episodeService->toggleSeason($tmdbId, $season, $seen);
9696
}

backend/app/Http/Controllers/SettingController.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use GuzzleHttp\Client;
1010
use Illuminate\Support\Facades\Auth;
1111
use Illuminate\Support\Facades\Cache;
12-
use Illuminate\Support\Facades\Input;
12+
use Illuminate\Support\Facades\Request;
1313

1414
class SettingController {
1515

@@ -83,13 +83,13 @@ public function getVersion()
8383
public function updateSettings()
8484
{
8585
Cache::flush();
86-
86+
8787
$this->setting->first()->update([
88-
'show_genre' => Input::get('genre'),
89-
'show_date' => Input::get('date'),
90-
'episode_spoiler_protection' => Input::get('spoiler'),
91-
'show_watchlist_everywhere' => Input::get('watchlist'),
92-
'show_ratings' => Input::get('ratings'),
88+
'show_genre' => Request::input('genre'),
89+
'show_date' => Request::input('date'),
90+
'episode_spoiler_protection' => Request::input('spoiler'),
91+
'show_watchlist_everywhere' => Request::input('watchlist'),
92+
'show_ratings' => Request::input('ratings'),
9393
]);
9494
}
9595

@@ -99,28 +99,28 @@ public function updateSettings()
9999
public function updateRefresh()
100100
{
101101
$this->setting->first()->update([
102-
'refresh_automatically' => Input::get('refresh'),
102+
'refresh_automatically' => Request::input('refresh'),
103103
]);
104104
}
105-
105+
106106
/**
107107
* Update reminders mail.
108108
*/
109109
public function updateRemindersSendTo()
110110
{
111111
$this->setting->first()->update([
112-
'reminders_send_to' => Input::get('reminders_send_to'),
112+
'reminders_send_to' => Request::input('reminders_send_to'),
113113
]);
114114
}
115-
115+
116116
/**
117117
* Update reminder options.
118118
*/
119119
public function updateReminderOptions()
120120
{
121121
$this->setting->first()->update([
122-
'daily_reminder' => Input::get('daily'),
123-
'weekly_reminder' => Input::get('weekly'),
122+
'daily_reminder' => Request::input('daily'),
123+
'weekly_reminder' => Request::input('weekly'),
124124
]);
125125
}
126126
}

backend/app/Http/Controllers/TMDBController.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Services\TMDB;
66
use Illuminate\Support\Facades\Input;
7+
use Illuminate\Support\Facades\Request;
78

89
class TMDBController {
910

@@ -16,14 +17,14 @@ public function __construct(TMDB $tmdb)
1617

1718
public function search()
1819
{
19-
return $this->tmdb->search(Input::get('q'));
20+
return $this->tmdb->search(Request::input('q'));
2021
}
2122

2223
public function suggestions($tmdbId, $mediaType)
2324
{
2425
return $this->tmdb->suggestions($mediaType, $tmdbId);
2526
}
26-
27+
2728
public function genre($genre)
2829
{
2930
return $this->tmdb->byGenre($genre);

backend/app/Http/Controllers/UserController.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Illuminate\Contracts\Auth\Guard;
66
use Illuminate\Support\Facades\Auth;
7-
use Illuminate\Support\Facades\Input;
7+
use Illuminate\Support\Facades\Request;
88

99
class UserController {
1010

@@ -22,8 +22,8 @@ public function __construct(Guard $auth)
2222
*/
2323
public function login()
2424
{
25-
$username = Input::get('username');
26-
$password = Input::get('password');
25+
$username = Request::input('username');
26+
$password = Request::input('password');
2727

2828
if($this->auth->attempt(['username' => $username, 'password' => $password], true)) {
2929
return response('Success', 200);
@@ -49,8 +49,8 @@ public function getUserData()
4949
*/
5050
public function changeUserData()
5151
{
52-
$username = Input::get('username');
53-
$password = Input::get('password');
52+
$username = Request::input('username');
53+
$password = Request::input('password');
5454

5555
$user = Auth::user();
5656
$user->username = $username;

backend/app/Services/Models/ItemService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function create($data)
6666
$item = $this->model->store($data);
6767

6868
$this->episodeService->create($item);
69-
$this->genreService->sync($item, $data['genre_ids']);
69+
$this->genreService->sync($item, $data['genre_ids'] ?? []);
7070
$this->alternativeTitleService->create($item);
7171

7272
$this->storage->downloadImages($item->poster, $item->backdrop);

backend/app/helpers.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ function mediaType($mediaType)
1717

1818
function getSlug($title)
1919
{
20-
return str_slug($title) != '' ? str_slug($title) : 'no-slug-available';
20+
$slug = Illuminate\Support\Str::slug($title);
21+
22+
return $slug != '' ? $slug : 'no-slug-available';
2123
}
2224

2325
// There is no 'EN' region in TMDb.
2426
function getRegion($translation)
2527
{
2628
return strtolower($translation) == 'en' ? 'us' : $translation;
2729
}
28-
30+
2931
function logInfo($message, $context = [])
3032
{
3133
if( ! app()->runningUnitTests()) {

backend/composer.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,20 @@
1313
"license": "MIT",
1414
"type": "project",
1515
"require": {
16-
"php": "^7.1.3",
17-
"doctrine/dbal": "^2.8",
16+
"php": "^7.2",
17+
"doctrine/dbal": "^2.10",
1818
"fideloper/proxy": "^4.0",
1919
"guzzlehttp/guzzle": "^6.3",
20-
"imangazaliev/didom": "^1.13",
21-
"laravel/framework": "5.8.*",
22-
"laravel/tinker": "^1.0",
23-
"morrislaptop/laravel-queue-clear": "^1.1",
20+
"imangazaliev/didom": "^1.14",
21+
"laravel/framework": "6.8.*",
22+
"laravel/tinker": "^2.0",
2423
"ext-json": "*"
2524
},
2625
"require-dev": {
27-
"filp/whoops": "~2.0",
26+
"facade/ignition": "^1.4",
2827
"fzaninotto/faker": "~1.4",
29-
"mockery/mockery": "~1.0",
30-
"phpunit/phpunit": "^7.0",
28+
"mockery/mockery": "^1.0",
29+
"phpunit/phpunit": "^8.0",
3130
"symfony/css-selector": "3.3.*",
3231
"symfony/dom-crawler": "3.3.*"
3332
},

0 commit comments

Comments
 (0)