Skip to content

Commit

Permalink
Update to laravel 7
Browse files Browse the repository at this point in the history
  • Loading branch information
KodeStar committed Mar 10, 2022
1 parent 61a5a1a commit f9a19fc
Show file tree
Hide file tree
Showing 7,170 changed files with 272,929 additions and 282,513 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 7 additions & 19 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

class Handler extends ExceptionHandler
{
Expand All @@ -22,32 +22,20 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];

/**
* Report or log an exception.
* Register the exception handling callbacks for the application.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function register()
{
return parent::render($request, $exception);
$this->reportable(function (Throwable $e) {
//
});
}
}
23 changes: 23 additions & 0 deletions app/Helper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Illuminate\Support\Str;

function format_bytes($bytes, $is_drive_size = true, $beforeunit = '', $afterunit = '')
{
$btype = ($is_drive_size === true) ? 1000 : 1024;
Expand All @@ -11,6 +13,27 @@ function format_bytes($bytes, $is_drive_size = true, $beforeunit = '', $afteruni
else return(round($bytes, 0).$beforeunit.$labels[$x].$afterunit);
}

function str_slug($title, $separator = '-', $language = 'en')
{
return Str::slug($title, $separator, $language);
}

if (! function_exists('str_is')) {
/**
* Determine if a given string matches a given pattern.
*
* @param string|array $pattern
* @param string $value
* @return bool
*
* @deprecated Str::is() should be used directly instead. Will be removed in Laravel 6.0.
*/
function str_is($pattern, $value)
{
return Str::is($pattern, $value);
}
}

function get_brightness($hex) {
// returns brightness value from 0 to 255
// strip off any leading #
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function update(Request $request, $id)
$user = $this->user();

if (!is_null($setting)) {
$data = Setting::getInput();
$data = Setting::getInput($request);

$setting_value = null;

Expand Down
7 changes: 4 additions & 3 deletions app/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Auth;
use App\User;
use App\Search;
use Illuminate\Http\Request;

class Setting extends Model
{
Expand Down Expand Up @@ -39,11 +40,11 @@ class Setting extends Model
/**
* @return array
*/
public static function getInput()
public static function getInput(Request $request)
{
return (object) [
'value' => Input::get('value'),
'image' => Input::file('value'),
'value' => $request->input('value'),
'image' => $request->file('value'),
];
}

Expand Down
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"require": {
"php": ">=7.1.3",
"fideloper/proxy": "^4.0",
"graham-campbell/github": "^7.5",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.7.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.5",
"php-http/guzzle6-adapter": "^1.1"
"graham-campbell/github": "^10.5",
"guzzlehttp/guzzle": "^7.4",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.4",
"laravelcollective/html": "^6.0"
},
"require-dev": {
"filp/whoops": "~2.0",
Expand Down Expand Up @@ -59,6 +59,10 @@
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
"optimize-autoloader": true,
"allow-plugins": {
"kylekatarnls/update-helper": true,
"symfony/thanks": true
}
}
}
Loading

0 comments on commit f9a19fc

Please sign in to comment.