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

Commit

Permalink
prepare for L5.8 (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
balping authored Jun 8, 2019
1 parent 55fc541 commit f3358bf
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ticketit

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.
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.
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.

## Features:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "kordy/ticketit",
"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",
"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",
"type": "laravel-package",
"keywords": ["laravel","helpdesk", "ticket", "support"],
"require": {
"laravel/framework": "^5.1",
"laravelcollective/html": "^5.1",
"illuminate/support": "^5.1",
"yajra/laravel-datatables-oracle": "^6.0|^8.0",
"yajra/laravel-datatables-oracle": "^6.0|^8.0|^9.4",
"jenssegers/date": "^3.0",
"mews/purifier": "^2.0",
"doctrine/dbal": "^2.5|^2.6"
Expand Down
5 changes: 4 additions & 1 deletion src/Controllers/CategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Kordy\Ticketit\Models\Category;
use Kordy\Ticketit\Helpers\LaravelVersion;

class CategoriesController extends Controller
{
Expand All @@ -16,7 +17,9 @@ class CategoriesController extends Controller
*/
public function index()
{
$categories = \Cache::remember('ticketit::categories', 60, function () {
// seconds expected for L5.8<=, minutes before that
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
$categories = \Cache::remember('ticketit::categories', $time, function () {
return Category::all();
});

Expand Down
5 changes: 4 additions & 1 deletion src/Controllers/PrioritiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Kordy\Ticketit\Models\Priority;
use Kordy\Ticketit\Helpers\LaravelVersion;

class PrioritiesController extends Controller
{
Expand All @@ -16,7 +17,9 @@ class PrioritiesController extends Controller
*/
public function index()
{
$priorities = \Cache::remember('ticketit::priorities', 60, function () {
// seconds expected for L5.8<=, minutes before that
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
$priorities = \Cache::remember('ticketit::priorities', $time, function () {
return Priority::all();
});

Expand Down
5 changes: 4 additions & 1 deletion src/Controllers/StatusesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Kordy\Ticketit\Models\Status;
use Kordy\Ticketit\Helpers\LaravelVersion;

class StatusesController extends Controller
{
Expand All @@ -16,7 +17,9 @@ class StatusesController extends Controller
*/
public function index()
{
$statuses = \Cache::remember('ticketit::statuses', 60, function () {
// seconds expected for L5.8<=, minutes before that
$time = LaravelVersion::min('5.8') ? 60*60 : 60;
$statuses = \Cache::remember('ticketit::statuses', $time, function () {
return Status::all();
});

Expand Down
9 changes: 6 additions & 3 deletions src/Controllers/TicketsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,18 @@ public function indexComplete()
*/
protected function PCS()
{
$priorities = Cache::remember('ticketit::priorities', 60, function () {
// seconds expected for L5.8<=, minutes before that
$time = LaravelVersion::min('5.8') ? 60*60 : 60;

$priorities = Cache::remember('ticketit::priorities', $time, function () {
return Models\Priority::all();
});

$categories = Cache::remember('ticketit::categories', 60, function () {
$categories = Cache::remember('ticketit::categories', $time, function () {
return Models\Category::all();
});

$statuses = Cache::remember('ticketit::statuses', 60, function () {
$statuses = Cache::remember('ticketit::statuses', $time, function () {
return Models\Status::all();
});

Expand Down
6 changes: 3 additions & 3 deletions src/Helpers/Cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
*/
class Cdn
{
const CodeMirror = '5.40.0';
const Summernote = '0.8.10';
const CodeMirror = '5.47.0';
const Summernote = '0.8.12';
const FontAwesome = '4.7.0';
const FontAwesome5 = '5.3.1';
const FontAwesome5 = '5.9.0';

// https://datatables.net/download/
const DataTables = '1.10.18';
Expand Down
3 changes: 2 additions & 1 deletion src/Helpers/EditorLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Kordy\Ticketit\Helpers;

use Kordy\Ticketit\Models\Setting;
use Illuminate\Support\Arr;

class EditorLocale
{
Expand Down Expand Up @@ -39,7 +40,7 @@ public static function getEditorLocale()
'vi' => 'vi-VN',
'zh' => 'zh-CN',
];
$editor_locale = array_get($map, $editor_locale, $editor_locale.'-'.strtoupper($editor_locale));
$editor_locale = Arr::get($map, $editor_locale, $editor_locale.'-'.strtoupper($editor_locale));

return $editor_locale;
}
Expand Down
8 changes: 6 additions & 2 deletions src/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Cache;
use Illuminate\Database\Eloquent\Model;
use Kordy\Ticketit\Models\Setting as Table;
use Kordy\Ticketit\Helpers\LaravelVersion;

class Setting extends Model
{
Expand Down Expand Up @@ -48,8 +49,11 @@ public static function grab($slug)
*/
// Cache::flush();

$setting = Cache::remember('ticketit::settings.'.$slug, 60, function () use ($slug) {
$settings = Cache::remember('ticketit::settings', 60, function () {
// seconds expected for L5.8<=, minutes before that
$time = LaravelVersion::min('5.8') ? 60*60 : 60;

$setting = Cache::remember('ticketit::settings.'.$slug, $time, function () use ($slug, $time) {
$settings = Cache::remember('ticketit::settings', $time, function () {
return Table::all();
});

Expand Down

0 comments on commit f3358bf

Please sign in to comment.