Skip to content

Commit

Permalink
Upgrading To 6.0 From 5.8 (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Sep 4, 2019
1 parent 0363ae1 commit 786aaa9
Show file tree
Hide file tree
Showing 28 changed files with 619 additions and 370 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -12,7 +12,7 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{blade.php,scss,yml}]
[*.{blade.php,scss,yml,yaml}]
indent_size = 2

[*.md]
Expand Down
2 changes: 1 addition & 1 deletion .env.testing
@@ -1,6 +1,6 @@
APP_NAME=URLHub
APP_ENV=local
APP_KEY=
APP_KEY=base64:SsuVzwH9xQnlEqSgTdTbBKyJ0rYrgt5Wr71vv02jDV8=
APP_DEBUG=true
APP_URL=http://localhost

Expand Down
1 change: 1 addition & 0 deletions app/Console/Kernel.php
Expand Up @@ -17,6 +17,7 @@ class Kernel extends ConsoleKernel
];

/**
* @codeCoverageIgnore
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
Expand Down
6 changes: 4 additions & 2 deletions app/Helpers/UrlHlp.php
Expand Up @@ -2,6 +2,8 @@

namespace App\Helpers;

use Illuminate\Support\Str;

class UrlHlp
{
/**
Expand All @@ -12,10 +14,10 @@ class UrlHlp
public function url_limit($url, $maxlength)
{
$int_a = $maxlength * 0.6;
$int_b = ($maxlength * 0.4 * -1) + 3; // + 3 dots from str_limit()
$int_b = ($maxlength * 0.4 * -1) + 3; // + 3 dots from Str::limit()

if (strlen($url) > $maxlength) {
return str_limit($url, $int_a).substr($url, $int_b);
return Str::limit($url, $int_a).substr($url, $int_b);
}

return $url;
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Backend/AllUrlController.php
Expand Up @@ -4,6 +4,7 @@

use App\Http\Controllers\Controller;
use App\Url;
use Illuminate\Support\Str;
use Yajra\Datatables\Datatables;

class AllUrlController extends Controller
Expand Down Expand Up @@ -37,7 +38,7 @@ public function getData()
})
->editColumn('long_url', function ($url) {
return '
<span title="'.$url->meta_title.'" data-toggle="tooltip">'.str_limit($url->meta_title, 90).'</span>
<span title="'.$url->meta_title.'" data-toggle="tooltip">'.Str::limit($url->meta_title, 90).'</span>
<br>
<a href="'.$url->long_url.'" target="_blank" title="'.$url->long_url.'" data-toggle="tooltip" class="text-muted">'.url_limit($url->long_url, 70).'</a>';
})
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Backend/DashboardController.php
Expand Up @@ -6,6 +6,7 @@
use App\Url;
use App\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Yajra\Datatables\Datatables;

class DashboardController extends Controller
Expand Down Expand Up @@ -60,7 +61,7 @@ public function getData()
})
->editColumn('long_url', function ($url) {
return '
<span title="'.$url->meta_title.'" data-toggle="tooltip">'.str_limit($url->meta_title, 90).'</span>
<span title="'.$url->meta_title.'" data-toggle="tooltip">'.Str::limit($url->meta_title, 90).'</span>
<br>
<a href="'.$url->long_url.'" target="_blank" title="'.$url->long_url.'" data-toggle="tooltip" class="text-muted">'.url_limit($url->long_url, 70).'</a>';
})
Expand Down
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Expand Up @@ -76,6 +76,7 @@ class Kernel extends HttpKernel
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
Expand Down
3 changes: 2 additions & 1 deletion app/Url.php
Expand Up @@ -5,6 +5,7 @@
use App\Http\Traits\Hashidable;
use Hidehalo\Nanoid\Client;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;

class Url extends Model
{
Expand Down Expand Up @@ -192,7 +193,7 @@ public function getTitle($url)
return $matches[1];
} elseif ($domain = $this->getDomain($url)) {
// @codeCoverageIgnoreStart
return title_case($domain).' - '.__('No Title'); // @codeCoverageIgnoreEnd
return Str::title($domain).' - '.__('No Title'); // @codeCoverageIgnoreEnd
} else {
return __('No Title');
}
Expand Down
3 changes: 2 additions & 1 deletion app/User.php
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Laravolt\Avatar\Facade as Avatar;
use Spatie\Permission\Traits\HasRoles;

Expand Down Expand Up @@ -63,7 +64,7 @@ public function getAvatarAttribute()
}

// Create unique avatar based on their email
return Avatar::create(title_case($this->email))->toBase64();
return Avatar::create(Str::title($this->email))->toBase64();
}

/*
Expand Down
17 changes: 8 additions & 9 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "laravel/laravel",
"name": "realodix/urlhub",
"type": "project",
"description": "The Laravel Framework.",
"description": "URL shortener web application based on the Laravel PHP Framework.",
"keywords": [
"laravel",
"url-shortener",
Expand All @@ -13,21 +13,20 @@
"php": "^7.2",
"codeitnowin/barcode": "^3.0",
"creativeorange/gravatar": "~1.0",
"davejamesmiller/laravel-breadcrumbs": "^5.1",
"davejamesmiller/laravel-breadcrumbs": "^5.3",
"fideloper/proxy": "^4.0",
"geoip2/geoip2": "~2.0",
"hidehalo/nanoid-php": "^1.1",
"jenssegers/agent": "^2.6",
"laravel/framework": "5.8.*",
"laravel/framework": "^6.0",
"laravel/tinker": "^1.0",
"laravolt/avatar": "^2.0",
"spatie/laravel-permission": "^2.17",
"vinkla/hashids": "^6.0",
"laravolt/avatar": "^3.0",
"spatie/laravel-permission": "^3.0",
"vinkla/hashids": "^7.0",
"yajra/laravel-datatables-oracle": "~9.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
Expand Down

0 comments on commit 786aaa9

Please sign in to comment.