Skip to content
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit f3358bf

Browse files
authored
prepare for L5.8 (#520)
1 parent 55fc541 commit f3358bf

9 files changed

Lines changed: 32 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ticketit
22

3-
A simple helpdesk tickets system for Laravel 5.1+ (5.1, 5.2, 5.3, 5.4, 5.5, 5.6 and 5.7) which integrates smoothly with Laravel default users and auth system.
3+
A simple helpdesk tickets system for Laravel 5.1+ (5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7 and 5.8) which integrates smoothly with Laravel default users and auth system.
44
It will integrate into your current Laravel project within minutes, and you can offer your customers and your team a nice and simple support ticket system.
55

66
## Features:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "kordy/ticketit",
3-
"description": "A simple helpdesk tickets system for Laravel 5.1, 5.2, 5.3, 5.4, 5.5, 5.6 and 5.7 which integrates smoothly with Laravel default users and auth system",
3+
"description": "A simple helpdesk tickets system for Laravel 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7 and 5.8 which integrates smoothly with Laravel default users and auth system",
44
"type": "laravel-package",
55
"keywords": ["laravel","helpdesk", "ticket", "support"],
66
"require": {
77
"laravel/framework": "^5.1",
88
"laravelcollective/html": "^5.1",
99
"illuminate/support": "^5.1",
10-
"yajra/laravel-datatables-oracle": "^6.0|^8.0",
10+
"yajra/laravel-datatables-oracle": "^6.0|^8.0|^9.4",
1111
"jenssegers/date": "^3.0",
1212
"mews/purifier": "^2.0",
1313
"doctrine/dbal": "^2.5|^2.6"

src/Controllers/CategoriesController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\Session;
88
use Kordy\Ticketit\Models\Category;
9+
use Kordy\Ticketit\Helpers\LaravelVersion;
910

1011
class CategoriesController extends Controller
1112
{
@@ -16,7 +17,9 @@ class CategoriesController extends Controller
1617
*/
1718
public function index()
1819
{
19-
$categories = \Cache::remember('ticketit::categories', 60, function () {
20+
// seconds expected for L5.8<=, minutes before that
21+
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
22+
$categories = \Cache::remember('ticketit::categories', $time, function () {
2023
return Category::all();
2124
});
2225

src/Controllers/PrioritiesController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\Session;
88
use Kordy\Ticketit\Models\Priority;
9+
use Kordy\Ticketit\Helpers\LaravelVersion;
910

1011
class PrioritiesController extends Controller
1112
{
@@ -16,7 +17,9 @@ class PrioritiesController extends Controller
1617
*/
1718
public function index()
1819
{
19-
$priorities = \Cache::remember('ticketit::priorities', 60, function () {
20+
// seconds expected for L5.8<=, minutes before that
21+
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
22+
$priorities = \Cache::remember('ticketit::priorities', $time, function () {
2023
return Priority::all();
2124
});
2225

src/Controllers/StatusesController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Http\Request;
77
use Illuminate\Support\Facades\Session;
88
use Kordy\Ticketit\Models\Status;
9+
use Kordy\Ticketit\Helpers\LaravelVersion;
910

1011
class StatusesController extends Controller
1112
{
@@ -16,7 +17,9 @@ class StatusesController extends Controller
1617
*/
1718
public function index()
1819
{
19-
$statuses = \Cache::remember('ticketit::statuses', 60, function () {
20+
// seconds expected for L5.8<=, minutes before that
21+
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
22+
$statuses = \Cache::remember('ticketit::statuses', $time, function () {
2023
return Status::all();
2124
});
2225

src/Controllers/TicketsController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,18 @@ public function indexComplete()
165165
*/
166166
protected function PCS()
167167
{
168-
$priorities = Cache::remember('ticketit::priorities', 60, function () {
168+
// seconds expected for L5.8<=, minutes before that
169+
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
170+
171+
$priorities = Cache::remember('ticketit::priorities', $time, function () {
169172
return Models\Priority::all();
170173
});
171174

172-
$categories = Cache::remember('ticketit::categories', 60, function () {
175+
$categories = Cache::remember('ticketit::categories', $time, function () {
173176
return Models\Category::all();
174177
});
175178

176-
$statuses = Cache::remember('ticketit::statuses', 60, function () {
179+
$statuses = Cache::remember('ticketit::statuses', $time, function () {
177180
return Models\Status::all();
178181
});
179182

src/Helpers/Cdn.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
*/
1111
class Cdn
1212
{
13-
const CodeMirror = '5.40.0';
14-
const Summernote = '0.8.10';
13+
const CodeMirror = '5.47.0';
14+
const Summernote = '0.8.12';
1515
const FontAwesome = '4.7.0';
16-
const FontAwesome5 = '5.3.1';
16+
const FontAwesome5 = '5.9.0';
1717

1818
// https://datatables.net/download/
1919
const DataTables = '1.10.18';

src/Helpers/EditorLocale.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Kordy\Ticketit\Helpers;
44

55
use Kordy\Ticketit\Models\Setting;
6+
use Illuminate\Support\Arr;
67

78
class EditorLocale
89
{
@@ -39,7 +40,7 @@ public static function getEditorLocale()
3940
'vi' => 'vi-VN',
4041
'zh' => 'zh-CN',
4142
];
42-
$editor_locale = array_get($map, $editor_locale, $editor_locale.'-'.strtoupper($editor_locale));
43+
$editor_locale = Arr::get($map, $editor_locale, $editor_locale.'-'.strtoupper($editor_locale));
4344

4445
return $editor_locale;
4546
}

src/Models/Setting.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Cache;
66
use Illuminate\Database\Eloquent\Model;
77
use Kordy\Ticketit\Models\Setting as Table;
8+
use Kordy\Ticketit\Helpers\LaravelVersion;
89

910
class Setting extends Model
1011
{
@@ -48,8 +49,11 @@ public static function grab($slug)
4849
*/
4950
// Cache::flush();
5051

51-
$setting = Cache::remember('ticketit::settings.'.$slug, 60, function () use ($slug) {
52-
$settings = Cache::remember('ticketit::settings', 60, function () {
52+
// seconds expected for L5.8<=, minutes before that
53+
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
54+
55+
$setting = Cache::remember('ticketit::settings.'.$slug, $time, function () use ($slug, $time) {
56+
$settings = Cache::remember('ticketit::settings', $time, function () {
5357
return Table::all();
5458
});
5559

0 commit comments

Comments
 (0)