Просмотр исходного кода

update laravel framework from 5.5 to 5.6

admin 7 лет назад
Родитель
Сommit
c7713201a6

+ 1 - 1
_ide_helper.php

@@ -3,7 +3,7 @@
 
 /**
  * A helper file for Laravel 5, to provide autocomplete information to your IDE
- * Generated for Laravel 5.6.39 on 2019-01-16 14:36:12.
+ * Generated for Laravel 5.6.39 on 2019-01-17 01:33:55.
  *
  * This file should not be included in your code, only analyzed by your IDE!
  *

+ 16 - 12
app/Console/Commands/AutoClearLog.php

@@ -10,6 +10,7 @@ use App\Http\Models\SsNodeTrafficHourly;
 use App\Http\Models\SsNodeTrafficDaily;
 use App\Http\Models\UserBanLog;
 use App\Http\Models\UserLoginLog;
+use App\Http\Models\UserTrafficDaily;
 use App\Http\Models\UserTrafficLog;
 use App\Http\Models\UserTrafficHourly;
 use Illuminate\Console\Command;
@@ -49,28 +50,31 @@ class AutoClearLog extends Command
         SsNodeInfo::query()->where('log_time', '<=', strtotime("-30 minutes"))->delete();
 
         // 自动清除1小时以前的节点在线用户数日志
-        SsNodeOnlineLog::query()->where('log_time', '<=', strtotime("-60 minutes"))->delete();
+        SsNodeOnlineLog::query()->where('log_time', '<=', strtotime("-1 hour"))->delete();
 
-        // 自动清除30天以前的用户流量日志
-        UserTrafficLog::query()->where('log_time', '<=', strtotime("-30 days"))->delete();
+        // 自动清除1个月以前的用户流量日志
+        UserTrafficLog::query()->where('log_time', '<=', strtotime("-1 month"))->delete();
 
         // 自动清除10天以前的用户每小时流量数据日志
         UserTrafficHourly::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-10 days')))->delete();
 
-        // 自动清除60天以前的节点每小时流量数据日志
-        SsNodeTrafficHourly::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-60 days')))->delete();
+        // 自动清除1个月以前的用户每天流量数据日志
+        UserTrafficDaily::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-1 month')))->delete();
 
-        // 自动清除90天以前的节点每天流量数据日志
-        SsNodeTrafficDaily::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-90 days')))->delete();
+        // 自动清除2个月以前的节点每小时流量数据日志
+        SsNodeTrafficHourly::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-2 month')))->delete();
+
+        // 自动清除3个月以前的节点每天流量数据日志
+        SsNodeTrafficDaily::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 month')))->delete();
 
         // 自动清除30天以前用户封禁日志
-        UserBanLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-30 days")))->delete();
+        UserBanLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-1 month")))->delete();
 
-        // 自动清除30天以前用户连接IP
-        SsNodeIp::query()->where('created_at', '<=', strtotime("-30 days"))->delete();
+        // 自动清除1个月以前用户连接IP
+        SsNodeIp::query()->where('created_at', '<=', strtotime("-1 month"))->delete();
 
-        // 自动清除30天以前用户登陆日志
-        UserLoginLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-30 days")))->delete();
+        // 自动清除3个月以前用户登陆日志
+        UserLoginLog::query()->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("-3 month")))->delete();
     }
 
 }

+ 30 - 7
app/Exceptions/Handler.php

@@ -2,11 +2,13 @@
 
 namespace App\Exceptions;
 
+use ErrorException;
 use Exception;
 use Illuminate\Auth\AuthenticationException;
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 use Illuminate\Session\TokenMismatchException;
 use ReflectionException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 class Handler extends ExceptionHandler
 {
@@ -39,6 +41,9 @@ class Handler extends ExceptionHandler
      */
     public function report(Exception $exception)
     {
+        // 记录异常来源
+        \Log::info('异常来源:' . get_class($exception));
+
         parent::report($exception);
     }
 
@@ -52,28 +57,37 @@ class Handler extends ExceptionHandler
      */
     public function render($request, Exception $exception)
     {
-        \Log::info("异常请求:" . $request->fullUrl() . ",IP:" . getClientIp());
-
         // 调试模式下直接返回错误信息
         if (config('app.debug')) {
             return parent::render($request, $exception);
         }
 
+        // 捕获访问异常
+        if ($exception instanceof NotFoundHttpException) {
+            \Log::info("异常请求:" . $request->fullUrl() . ",IP:" . getClientIp());
+
+            if ($request->ajax()) {
+                return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Page Not Found']);
+            } else {
+                return response()->view('auth.error', ['message' => 'Page Not Found']);
+            }
+        }
+
         // 捕获身份校验异常
         if ($exception instanceof AuthenticationException) {
             if ($request->ajax()) {
                 return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Unauthorized']);
             } else {
-                return response()->view('error.404');
+                return response()->view('auth.error', ['message' => 'Unauthorized']);
             }
         }
 
         // 捕获CSRF异常
         if ($exception instanceof TokenMismatchException) {
             if ($request->ajax()) {
-                return response()->json(['status' => 'fail', 'data' => '', 'message' => trans('404.csrf_title')]);
+                return response()->json(['status' => 'fail', 'data' => '', 'message' => 'Refresh Page, Try One More Time']);
             } else {
-                return response()->view('error.csrf');
+                return response()->view('auth.error', ['message' => 'Refresh Page, Try One More Time']);
             }
         }
 
@@ -82,10 +96,19 @@ class Handler extends ExceptionHandler
             if ($request->ajax()) {
                 return response()->json(['status' => 'fail', 'data' => '', 'message' => 'System Error']);
             } else {
-                return response()->view('error.404');
+                return response()->view('auth.error', ['message' => 'System Error']);
+            }
+        }
+
+        // 捕获系统错误异常
+        if ($exception instanceof ErrorException) {
+            if ($request->ajax()) {
+                return response()->json(['status' => 'fail', 'data' => '', 'message' => 'System Error']);
+            } else {
+                return response()->view('auth.error', ['message' => 'System Error, See <a href="/logs" target="_blank">Logs</a>']);
             }
         }
 
-        return response()->view('error.404');
+        return parent::render($request, $exception);
     }
 }

+ 2 - 3
app/Http/Middleware/RedirectIfAuthenticated.php

@@ -3,7 +3,6 @@
 namespace App\Http\Middleware;
 
 use Closure;
-use Illuminate\Support\Facades\Auth;
 
 class RedirectIfAuthenticated
 {
@@ -18,8 +17,8 @@ class RedirectIfAuthenticated
      */
     public function handle($request, Closure $next, $guard = null)
     {
-        if (Auth::guard($guard)->check()) {
-            return redirect('/home');
+        if (auth()->guard($guard)->check()) {
+            return redirect('/');
         }
 
         return $next($request);

+ 4 - 4
app/Http/Middleware/isForbidden.php

@@ -25,7 +25,7 @@ class isForbidden
             if (Agent::isRobot()) {
                 Log::info("识别到机器人访问(" . getClientIp() . ")");
 
-                return response()->view('error.404', [], 404);
+                return response()->view('auth.error', ['message' => ''], 404);
             }
         }
 
@@ -41,7 +41,7 @@ class isForbidden
 
         // 拒绝无IP请求
         if (empty($ipInfo) || empty($ipInfo['country'])) {
-            return response()->view('error.403', [], 403);
+            return response()->view('auth.error', ['message' => 'IP or Proxy Access Forbidden'], 403);
         }
 
         if (!in_array($ipInfo['country'], ['本机地址', '局域网'])) {
@@ -50,7 +50,7 @@ class isForbidden
                 if (($ipInfo['country'] == '中国' && !in_array($ipInfo['province'], ['香港', '澳门', '台湾'])) || ($isIPv6 && $ipInfo['country'] == 'China')) {
                     Log::info('识别到大陆IP,拒绝访问:' . $ip);
 
-                    return response()->view('error.403', [], 403);
+                    return response()->view('auth.error', ['message' => 'IP or Proxy Access Forbidden'], 403);
                 }
             }
 
@@ -59,7 +59,7 @@ class isForbidden
                 if ($ipInfo['country'] != '中国' || in_array($ipInfo['province'], ['香港', '澳门', '台湾']) || ($isIPv6 && $ipInfo['country'] != 'China')) {
                     Log::info('识别到海外IP,拒绝访问:' . $ip . ' - ' . $ipInfo['country']);
 
-                    return response()->view('error.403', [], 403);
+                    return response()->view('auth.error', ['message' => 'IP or Proxy Access Forbidden'], 403);
                 }
             }
         }

+ 3 - 1
app/Providers/AppServiceProvider.php

@@ -28,6 +28,8 @@ class AppServiceProvider extends ServiceProvider
      */
     public function register()
     {
-        //
+        if ($this->app->environment() !== 'production') {
+            $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
+        }
     }
 }

+ 0 - 17
bootstrap/autoload.php

@@ -1,17 +0,0 @@
-<?php
-
-define('LARAVEL_START', microtime(true));
-
-/*
-|--------------------------------------------------------------------------
-| Register The Composer Auto Loader
-|--------------------------------------------------------------------------
-|
-| Composer provides a convenient, automatically generated class loader
-| for our application. We just need to utilize it! We'll require it
-| into the script here so we do not have to manually load any of
-| our application's PHP classes. It just feels great to relax.
-|
-*/
-
-require __DIR__.'/../vendor/autoload.php';

+ 13 - 14
composer.json

@@ -6,23 +6,22 @@
     "type": "project",
     "require": {
         "php": "^7.1.3",
-        "barryvdh/laravel-ide-helper": "^2.4",
+        "barryvdh/laravel-ide-helper": "^2.5",
         "fideloper/proxy": "^4.0",
         "guzzlehttp/guzzle": "^6.3",
-        "ipip/db": "^0.6.0",
+        "ipip/db": "^1.0",
         "itbdw/ip-database": "^2.0",
-        "jenssegers/agent": "^2.5",
+        "jenssegers/agent": "^2.6",
         "laravel/framework": "5.6.*",
         "laravel/tinker": "^1.0",
-        "mews/captcha": "^2.1",
-        "mews/purifier": "^2.0",
+        "mews/captcha": "^2.2",
+        "mews/purifier": "^2.1",
         "openlss/lib-array2xml": "^0.5.1",
-        "overtrue/laravel-lang": "~3.0",
-        "paypal/rest-api-sdk-php": "*",
-        "phpoffice/phpspreadsheet": "^1.4",
+        "overtrue/laravel-lang": "^3.0",
+        "phpoffice/phpspreadsheet": "^1.6",
         "predis/predis": "^1.1",
-        "rap2hpoutre/laravel-log-viewer": "^0.19.1",
-        "spatie/laravel-permission": "^2.23",
+        "rap2hpoutre/laravel-log-viewer": "^1.0",
+        "spatie/laravel-permission": "^2.29",
         "youzan/open-sdk": "^1.0"
     },
     "require-dev": {
@@ -72,12 +71,12 @@
         "sort-packages": true,
         "optimize-autoloader": true
     },
-    "minimum-stability": "dev",
-    "prefer-stable": true,
-    "repositories": {
+	"repositories": {
         "packagist": {
             "type": "composer",
             "url": "https://packagist.laravel-china.org"
         }
-    }
+    },
+    "minimum-stability": "dev",
+    "prefer-stable": true
 }

+ 15 - 66
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "2b4ad7aadcf9ad1a0a48524529896343",
+    "content-hash": "0f9a76403962ab65ed544a820f7aa986",
     "packages": [
         {
             "name": "barryvdh/laravel-ide-helper",
@@ -1257,16 +1257,16 @@
         },
         {
             "name": "ipip/db",
-            "version": "v0.6",
+            "version": "v1.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/ipipdotnet/ipdb-php.git",
-                "reference": "f87777301eb886c68dbafb15d6a888bb3003a330"
+                "reference": "af42bf28b37dc76beccd7bbe2b0b0572e21f42cf"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/ipipdotnet/ipdb-php/zipball/f87777301eb886c68dbafb15d6a888bb3003a330",
-                "reference": "f87777301eb886c68dbafb15d6a888bb3003a330",
+                "url": "https://api.github.com/repos/ipipdotnet/ipdb-php/zipball/af42bf28b37dc76beccd7bbe2b0b0572e21f42cf",
+                "reference": "af42bf28b37dc76beccd7bbe2b0b0572e21f42cf",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -1305,7 +1305,7 @@
                 "ipdb",
                 "ipip.net"
             ],
-            "time": "2018-08-30T03:32:59+00:00"
+            "time": "2018-11-01T08:07:04+00:00"
         },
         {
             "name": "itbdw/ip-database",
@@ -2723,61 +2723,6 @@
             ],
             "time": "2018-07-02T15:55:56+00:00"
         },
-        {
-            "name": "paypal/rest-api-sdk-php",
-            "version": "1.14.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/paypal/PayPal-PHP-SDK.git",
-                "reference": "72e2f2466975bf128a31e02b15110180f059fc04"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/paypal/PayPal-PHP-SDK/zipball/72e2f2466975bf128a31e02b15110180f059fc04",
-                "reference": "72e2f2466975bf128a31e02b15110180f059fc04",
-                "shasum": "",
-                "mirrors": [
-                    {
-                        "url": "https://dl.laravel-china.org/%package%/%reference%.%type%",
-                        "preferred": true
-                    }
-                ]
-            },
-            "require": {
-                "ext-curl": "*",
-                "ext-json": "*",
-                "php": ">=5.3.0",
-                "psr/log": "^1.0.0"
-            },
-            "require-dev": {
-                "phpunit/phpunit": "^4.8.35"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-0": {
-                    "PayPal": "lib/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "Apache-2.0"
-            ],
-            "authors": [
-                {
-                    "name": "PayPal",
-                    "homepage": "https://github.com/paypal/rest-api-sdk-php/contributors"
-                }
-            ],
-            "description": "PayPal's PHP SDK for REST APIs",
-            "homepage": "http://paypal.github.io/PayPal-PHP-SDK/",
-            "keywords": [
-                "payments",
-                "paypal",
-                "rest",
-                "sdk"
-            ],
-            "time": "2019-01-04T20:04:25+00:00"
-        },
         {
             "name": "phpoffice/phpspreadsheet",
             "version": "1.6.0",
@@ -3368,16 +3313,16 @@
         },
         {
             "name": "rap2hpoutre/laravel-log-viewer",
-            "version": "v0.19.1",
+            "version": "v1.0.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/rap2hpoutre/laravel-log-viewer.git",
-                "reference": "3790892b2b912e7ebaf9ce9868bbe93d542309c7"
+                "reference": "68d1f3be193931214d1fa8ced88eed1e33b0e9ee"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/rap2hpoutre/laravel-log-viewer/zipball/3790892b2b912e7ebaf9ce9868bbe93d542309c7",
-                "reference": "3790892b2b912e7ebaf9ce9868bbe93d542309c7",
+                "url": "https://api.github.com/repos/rap2hpoutre/laravel-log-viewer/zipball/68d1f3be193931214d1fa8ced88eed1e33b0e9ee",
+                "reference": "68d1f3be193931214d1fa8ced88eed1e33b0e9ee",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -3390,6 +3335,10 @@
                 "illuminate/support": "4.2.*|5.*",
                 "php": ">=5.4.0"
             },
+            "require-dev": {
+                "orchestra/testbench": "^3.6",
+                "phpunit/phpunit": "^7"
+            },
             "type": "laravel-package",
             "extra": {
                 "laravel": {
@@ -3425,7 +3374,7 @@
                 "logging",
                 "lumen"
             ],
-            "time": "2018-07-17T21:31:45+00:00"
+            "time": "2019-01-02T21:10:18+00:00"
         },
         {
             "name": "seld/jsonlint",

+ 0 - 7
config/app.php

@@ -160,13 +160,6 @@ return [
         App\Providers\EventServiceProvider::class,
         App\Providers\RouteServiceProvider::class,
 
-        Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
-        Mews\Captcha\CaptchaServiceProvider::class,
-        Jenssegers\Agent\AgentServiceProvider::class,
-        Overtrue\LaravelLang\TranslationServiceProvider::class,
-        Mews\Purifier\PurifierServiceProvider::class,
-        Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,
-
     ],
 
     /*

+ 5 - 5
config/auth.php

@@ -14,7 +14,7 @@ return [
     */
 
     'defaults' => [
-        'guard'     => 'web',
+        'guard' => 'web',
         'passwords' => 'users',
     ],
 
@@ -37,12 +37,12 @@ return [
 
     'guards' => [
         'web' => [
-            'driver'   => 'session',
+            'driver' => 'session',
             'provider' => 'users',
         ],
 
         'api' => [
-            'driver'   => 'token',
+            'driver' => 'token',
             'provider' => 'users',
         ],
     ],
@@ -94,8 +94,8 @@ return [
     'passwords' => [
         'users' => [
             'provider' => 'users',
-            'table'    => 'password_resets',
-            'expire'   => 60,
+            'table' => 'password_resets',
+            'expire' => 60,
         ],
     ],
 

+ 21 - 4
config/ide-helper.php

@@ -13,6 +13,8 @@ return array(
 
     'filename'  => '_ide_helper',
     'format'    => 'php',
+    
+    'meta_filename' => '.phpstorm.meta.php',
 
     /*
     |--------------------------------------------------------------------------
@@ -36,6 +38,21 @@ return array(
 
     'write_model_magic_where' => true,
 
+    /*
+    |--------------------------------------------------------------------------
+    | Write Eloquent Model Mixins
+    |--------------------------------------------------------------------------
+    |
+    | This will add the necessary DocBlock mixins to the model class
+    | contained in the Laravel Framework. This helps the IDE with
+    | auto-completion.
+    |
+    | Please be aware that this setting changes a file within the /vendor directory.
+    |
+    */
+
+    'write_eloquent_model_mixins' => false,
+
     /*
     |--------------------------------------------------------------------------
     | Helper files to include
@@ -151,13 +168,13 @@ return array(
      |
      | For example, normally you would see this:
      |
-     |  * @property \Carbon\Carbon $created_at
-     |  * @property \Carbon\Carbon $updated_at
+     |  * @property \Illuminate\Support\Carbon $created_at
+     |  * @property \Illuminate\Support\Carbon $updated_at
      |
      | With this enabled, the properties will be this:
      |
-     |  * @property \Carbon\Carbon $createdAt
-     |  * @property \Carbon\Carbon $updatedAt
+     |  * @property \Illuminate\Support\Carbon $createdAt
+     |  * @property \Illuminate\Support\Carbon $updatedAt
      |
      | Note, it is currently an all-or-nothing option.
      |

+ 20 - 0
config/image.php

@@ -0,0 +1,20 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | Image Driver
+    |--------------------------------------------------------------------------
+    |
+    | Intervention Image supports "GD Library" and "Imagick" to process images
+    | internally. You may choose one of them according to your PHP
+    | configuration. By default PHP's "GD Library" implementation is used.
+    |
+    | Supported: "gd", "imagick"
+    |
+    */
+
+    'driver' => 'gd'
+
+];

+ 127 - 0
config/permission.php

@@ -0,0 +1,127 @@
+<?php
+
+return [
+
+    'models' => [
+
+        /*
+         * When using the "HasPermissions" trait from this package, we need to know which
+         * Eloquent model should be used to retrieve your permissions. Of course, it
+         * is often just the "Permission" model but you may use whatever you like.
+         *
+         * The model you want to use as a Permission model needs to implement the
+         * `Spatie\Permission\Contracts\Permission` contract.
+         */
+
+        'permission' => Spatie\Permission\Models\Permission::class,
+
+        /*
+         * When using the "HasRoles" trait from this package, we need to know which
+         * Eloquent model should be used to retrieve your roles. Of course, it
+         * is often just the "Role" model but you may use whatever you like.
+         *
+         * The model you want to use as a Role model needs to implement the
+         * `Spatie\Permission\Contracts\Role` contract.
+         */
+
+        'role' => Spatie\Permission\Models\Role::class,
+
+    ],
+
+    'table_names' => [
+
+        /*
+         * When using the "HasRoles" trait from this package, we need to know which
+         * table should be used to retrieve your roles. We have chosen a basic
+         * default value but you may easily change it to any table you like.
+         */
+
+        'roles' => 'roles',
+
+        /*
+         * When using the "HasPermissions" trait from this package, we need to know which
+         * table should be used to retrieve your permissions. We have chosen a basic
+         * default value but you may easily change it to any table you like.
+         */
+
+        'permissions' => 'permissions',
+
+        /*
+         * When using the "HasPermissions" trait from this package, we need to know which
+         * table should be used to retrieve your models permissions. We have chosen a
+         * basic default value but you may easily change it to any table you like.
+         */
+
+        'model_has_permissions' => 'model_has_permissions',
+
+        /*
+         * When using the "HasRoles" trait from this package, we need to know which
+         * table should be used to retrieve your models roles. We have chosen a
+         * basic default value but you may easily change it to any table you like.
+         */
+
+        'model_has_roles' => 'model_has_roles',
+
+        /*
+         * When using the "HasRoles" trait from this package, we need to know which
+         * table should be used to retrieve your roles permissions. We have chosen a
+         * basic default value but you may easily change it to any table you like.
+         */
+
+        'role_has_permissions' => 'role_has_permissions',
+    ],
+
+    'column_names' => [
+
+        /*
+         * Change this if you want to name the related model primary key other than
+         * `model_id`.
+         *
+         * For example, this would be nice if your primary keys are all UUIDs. In
+         * that case, name this `model_uuid`.
+         */
+        'model_morph_key' => 'model_id',
+    ],
+
+    /*
+     * When set to true, the required permission/role names are added to the exception
+     * message. This could be considered an information leak in some contexts, so
+     * the default setting is false here for optimum safety.
+     */
+
+    'display_permission_in_exception' => false,
+
+    'cache' => [
+
+        /*
+         * By default all permissions will be cached for 24 hours unless a permission or
+         * role is updated. Then the cache will be flushed immediately.
+         */
+
+        'expiration_time' => 60 * 24,
+
+        /*
+         * The key to use when tagging and prefixing entries in the cache.
+         */
+
+        'key' => 'spatie.permission.cache',
+
+        /*
+         * When checking for a permission against a model by passing a Permission
+         * instance to the check, this key determines what attribute on the
+         * Permissions model is used to cache against.
+         *
+         * Ideally, this should match your preferred way of checking permissions, eg:
+         * `$user->can('view-posts')` would be 'name'.
+         */
+
+        'model_key' => 'name',
+
+        /*
+         * You may optionally indicate a specific cache driver to use for permission and
+         * role caching using any of the `store` drivers listed in the cache.php config
+         * file. Using 'default' here means to use the `default` set in cache.php.
+         */
+        'store' => 'default',
+    ],
+];

+ 15 - 0
config/tinker.php

@@ -2,6 +2,21 @@
 
 return [
 
+    /*
+    |--------------------------------------------------------------------------
+    | Console Commands
+    |--------------------------------------------------------------------------
+    |
+    | This option allows you to add additional Artisan commands that should
+    | be available within the Tinker environment. Once the command is in
+    | this array you may execute the command in Tinker using its name.
+    |
+    */
+
+    'commands' => [
+        // App\Console\Commands\ExampleCommand::class,
+    ],
+
     /*
     |--------------------------------------------------------------------------
     | Alias Blacklist

+ 50 - 0
config/trustedproxy.php

@@ -0,0 +1,50 @@
+<?php
+
+return [
+
+    /*
+     * Set trusted proxy IP addresses.
+     *
+     * Both IPv4 and IPv6 addresses are
+     * supported, along with CIDR notation.
+     *
+     * The "*" character is syntactic sugar
+     * within TrustedProxy to trust any proxy
+     * that connects directly to your server,
+     * a requirement when you cannot know the address
+     * of your proxy (e.g. if using ELB or similar).
+     *
+     */
+    'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
+
+    /*
+     * To trust one or more specific proxies that connect
+     * directly to your server, use an array or a string separated by comma of IP addresses:
+     */
+    // 'proxies' => ['192.168.1.1'],
+    // 'proxies' => '192.168.1.1, 192.168.1.2',
+
+    /*
+     * Or, to trust all proxies that connect
+     * directly to your server, use a "*"
+     */
+    // 'proxies' => '*',
+
+    /*
+     * Which headers to use to detect proxy related data (For, Host, Proto, Port)
+     * 
+     * Options include:
+     * 
+     * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
+     * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
+     * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer)
+     *
+     * - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust)
+     * - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust)
+     * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)
+     * 
+     * @link https://symfony.com/doc/current/deployment/proxies.html
+     */
+    'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
+
+];

+ 102 - 0
database/migrations/2019_01_17_100504_create_permission_tables.php

@@ -0,0 +1,102 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePermissionTables extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        $tableNames = config('permission.table_names');
+        $columnNames = config('permission.column_names');
+
+        Schema::create($tableNames['permissions'], function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('name');
+            $table->string('guard_name');
+            $table->timestamps();
+        });
+
+        Schema::create($tableNames['roles'], function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('name');
+            $table->string('guard_name');
+            $table->timestamps();
+        });
+
+        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
+            $table->unsignedInteger('permission_id');
+
+            $table->string('model_type');
+            $table->unsignedBigInteger($columnNames['model_morph_key']);
+            $table->index([$columnNames['model_morph_key'], 'model_type', ]);
+
+            $table->foreign('permission_id')
+                ->references('id')
+                ->on($tableNames['permissions'])
+                ->onDelete('cascade');
+
+            $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'],
+                    'model_has_permissions_permission_model_type_primary');
+        });
+
+        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
+            $table->unsignedInteger('role_id');
+
+            $table->string('model_type');
+            $table->unsignedBigInteger($columnNames['model_morph_key']);
+            $table->index([$columnNames['model_morph_key'], 'model_type', ]);
+
+            $table->foreign('role_id')
+                ->references('id')
+                ->on($tableNames['roles'])
+                ->onDelete('cascade');
+
+            $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'],
+                    'model_has_roles_role_model_type_primary');
+        });
+
+        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
+            $table->unsignedInteger('permission_id');
+            $table->unsignedInteger('role_id');
+
+            $table->foreign('permission_id')
+                ->references('id')
+                ->on($tableNames['permissions'])
+                ->onDelete('cascade');
+
+            $table->foreign('role_id')
+                ->references('id')
+                ->on($tableNames['roles'])
+                ->onDelete('cascade');
+
+            $table->primary(['permission_id', 'role_id']);
+            
+            app('cache')
+                ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
+                ->forget(config('permission.cache.key'));
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        $tableNames = config('permission.table_names');
+
+        Schema::drop($tableNames['role_has_permissions']);
+        Schema::drop($tableNames['model_has_roles']);
+        Schema::drop($tableNames['model_has_permissions']);
+        Schema::drop($tableNames['roles']);
+        Schema::drop($tableNames['permissions']);
+    }
+}

+ 2 - 2
resources/views/error/403.blade.php → resources/views/auth/error.blade.php

@@ -8,7 +8,7 @@
 
 <head>
     <meta charset="utf-8" />
-    <title>403</title>
+    <title>ACCESS DENIED</title>
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta content="width=device-width, initial-scale=1" name="viewport" />
     <meta content="" name="description" />
@@ -37,7 +37,7 @@
     </div>
     <div class="container error-404">
         <h2>ACCESS DENIED</h2>
-        <p>IP or Proxy Access Forbidden</p>
+        <p>{!! $message !!}</p>
     </div>
     <!--[if lt IE 9]>
     <script src="/assets/global/plugins/respond.min.js"></script>

+ 0 - 77
resources/views/error/401.blade.php

@@ -1,77 +0,0 @@
-<!DOCTYPE html>
-<!--[if IE 8]> <html lang="{{app()->getLocale()}}" class="ie8 no-js"> <![endif]-->
-<!--[if IE 9]> <html lang="{{app()->getLocale()}}" class="ie9 no-js"> <![endif]-->
-<!--[if !IE]><!-->
-<html lang="{{app()->getLocale()}}">
-<!--<![endif]-->
-<!-- BEGIN HEAD -->
-
-<head>
-    <meta charset="utf-8" />
-    <title>401</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta content="width=device-width, initial-scale=1" name="viewport" />
-    <meta content="" name="description" />
-    <meta content="" name="author" />
-    <!-- BEGIN GLOBAL MANDATORY STYLES -->
-    <link href="/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
-    <!-- END GLOBAL MANDATORY STYLES -->
-    <!-- BEGIN THEME GLOBAL STYLES -->
-    <link href="/assets/global/css/components-rounded.min.css" rel="stylesheet" id="style_components" type="text/css" />
-    <link href="/assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
-    <!-- END THEME GLOBAL STYLES -->
-    <!-- BEGIN PAGE LEVEL STYLES -->
-    <link href="/assets/pages/css/error.min.css" rel="stylesheet" type="text/css" />
-    <!-- END PAGE LEVEL STYLES -->
-    <!-- BEGIN THEME LAYOUT STYLES -->
-    <!-- END THEME LAYOUT STYLES -->
-    <link rel="shortcut icon" href="{{asset('favicon.ico')}}" /> </head>
-<!-- END HEAD -->
-
-<body class="page-404-3">
-    <div class="page-inner">
-        <img src="/assets/pages/media/pages/earth.jpg" class="img-responsive" alt="">
-    </div>
-    <div class="container error-404">
-        <h2>ACCESS DENIED</h2>
-        <p>Unauthorized</p>
-        <p>
-            <a href="{{Request::server('HTTP_REFERER') ?? url('/')}}" class="btn red btn-outline"> 返回 </a>
-            <br>
-        </p>
-    </div>
-    <!--[if lt IE 9]>
-    <script src="/assets/global/plugins/respond.min.js"></script>
-    <script src="/assets/global/plugins/excanvas.min.js"></script>
-    <script src="/assets/global/plugins/ie8.fix.min.js"></script>
-    <![endif]-->
-    <!-- BEGIN CORE PLUGINS -->
-    <script src="/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
-    <script src="/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
-    <script src="/assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
-    <script src="/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
-    <script src="/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
-    <script src="/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
-    <!-- END CORE PLUGINS -->
-    <!-- BEGIN THEME GLOBAL SCRIPTS -->
-    <script src="/assets/global/scripts/app.min.js" type="text/javascript"></script>
-
-    <!-- Global site tag (gtag.js) - Google Analytics -->
-    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-122312249-1"></script>
-    <script>
-        window.dataLayer = window.dataLayer || [];
-        function gtag(){dataLayer.push(arguments);}
-        gtag('js', new Date());
-
-        gtag('config', 'UA-122312249-1');
-    </script>
-
-    <!-- END THEME GLOBAL SCRIPTS -->
-    <!-- BEGIN THEME LAYOUT SCRIPTS -->
-    <!-- END THEME LAYOUT SCRIPTS -->
-</body>
-
-</html>

+ 0 - 73
resources/views/error/404.blade.php

@@ -1,73 +0,0 @@
-<!DOCTYPE html>
-<!--[if IE 8]> <html lang="{{app()->getLocale()}}" class="ie8 no-js"> <![endif]-->
-<!--[if IE 9]> <html lang="{{app()->getLocale()}}" class="ie9 no-js"> <![endif]-->
-<!--[if !IE]><!-->
-<html lang="{{app()->getLocale()}}">
-<!--<![endif]-->
-<!-- BEGIN HEAD -->
-
-<head>
-    <meta charset="utf-8" />
-    <title>404</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta content="width=device-width, initial-scale=1" name="viewport" />
-    <meta content="" name="description" />
-    <meta content="" name="author" />
-    <!-- BEGIN GLOBAL MANDATORY STYLES -->
-    <link href="/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
-    <!-- END GLOBAL MANDATORY STYLES -->
-    <!-- BEGIN THEME GLOBAL STYLES -->
-    <link href="/assets/global/css/components-rounded.min.css" rel="stylesheet" id="style_components" type="text/css" />
-    <link href="/assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
-    <!-- END THEME GLOBAL STYLES -->
-    <!-- BEGIN PAGE LEVEL STYLES -->
-    <link href="/assets/pages/css/error.min.css" rel="stylesheet" type="text/css" />
-    <!-- END PAGE LEVEL STYLES -->
-    <!-- BEGIN THEME LAYOUT STYLES -->
-    <!-- END THEME LAYOUT STYLES -->
-    <link rel="shortcut icon" href="{{asset('favicon.ico')}}" /> </head>
-<!-- END HEAD -->
-
-<body class="page-404-full-page">
-<div class="row">
-    <div class="col-md-12 page-404">
-        <div class="number font-red"> <img src="{{asset('assets/images/404.png')}}" style="width:500px;" /> </div>
-        <p><br></p>
-        <a href="{{Request::server('HTTP_REFERER') ?? url('/')}}" class="btn btn-danger"> {{trans('404.back')}} </a>
-    </div>
-</div>
-<!--[if lt IE 9]>
-<script src="/assets/global/plugins/respond.min.js"></script>
-<script src="/assets/global/plugins/excanvas.min.js"></script>
-<script src="/assets/global/plugins/ie8.fix.min.js"></script>
-<![endif]-->
-<!-- BEGIN CORE PLUGINS -->
-<script src="/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
-<!-- END CORE PLUGINS -->
-<!-- BEGIN THEME GLOBAL SCRIPTS -->
-<script src="/assets/global/scripts/app.min.js" type="text/javascript"></script>
-
-<!-- Global site tag (gtag.js) - Google Analytics -->
-<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122312249-1"></script>
-<script>
-    window.dataLayer = window.dataLayer || [];
-    function gtag(){dataLayer.push(arguments);}
-    gtag('js', new Date());
-
-    gtag('config', 'UA-122312249-1');
-</script>
-
-<!-- END THEME GLOBAL SCRIPTS -->
-<!-- BEGIN THEME LAYOUT SCRIPTS -->
-<!-- END THEME LAYOUT SCRIPTS -->
-</body>
-
-</html>

+ 0 - 75
resources/views/error/csrf.blade.php

@@ -1,75 +0,0 @@
-<!DOCTYPE html>
-<!--[if IE 8]> <html lang="{{app()->getLocale()}}" class="ie8 no-js"> <![endif]-->
-<!--[if IE 9]> <html lang="{{app()->getLocale()}}" class="ie9 no-js"> <![endif]-->
-<!--[if !IE]><!-->
-<html lang="{{app()->getLocale()}}">
-<!--<![endif]-->
-<!-- BEGIN HEAD -->
-
-<head>
-    <meta charset="utf-8" />
-    <title>{{trans('404.csrf_title')}}</title>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta content="width=device-width, initial-scale=1" name="viewport" />
-    <meta content="" name="description" />
-    <meta content="" name="author" />
-    <!-- BEGIN GLOBAL MANDATORY STYLES -->
-    <link href="/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
-    <link href="/assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
-    <!-- END GLOBAL MANDATORY STYLES -->
-    <!-- BEGIN THEME GLOBAL STYLES -->
-    <link href="/assets/global/css/components-rounded.min.css" rel="stylesheet" id="style_components" type="text/css" />
-    <link href="/assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
-    <!-- END THEME GLOBAL STYLES -->
-    <!-- BEGIN PAGE LEVEL STYLES -->
-    <link href="/assets/pages/css/error.min.css" rel="stylesheet" type="text/css" />
-    <!-- END PAGE LEVEL STYLES -->
-    <!-- BEGIN THEME LAYOUT STYLES -->
-    <!-- END THEME LAYOUT STYLES -->
-    <link rel="shortcut icon" href="{{asset('favicon.ico')}}" /> </head>
-<!-- END HEAD -->
-
-<body class="page-500-full-page">
-<div class="row">
-    <div class="col-md-12 page-500">
-        <h3>{{trans('404.csrf_title')}}</h3>
-        <p><br></p>
-        <div class="number font-red"> <img src="{{asset('assets/images/404.png')}}" style="width:500px;" /> </div>
-        <p><br></p>
-        <a href="{{Request::server('HTTP_REFERER') ?? url('/')}}" class="btn default"> {{trans('404.csrf_back')}} </a>
-    </div>
-</div>
-<!--[if lt IE 9]>
-<script src="/assets/global/plugins/respond.min.js"></script>
-<script src="/assets/global/plugins/excanvas.min.js"></script>
-<script src="/assets/global/plugins/ie8.fix.min.js"></script>
-<![endif]-->
-<!-- BEGIN CORE PLUGINS -->
-<script src="/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
-<script src="/assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
-<!-- END CORE PLUGINS -->
-<!-- BEGIN THEME GLOBAL SCRIPTS -->
-<script src="/assets/global/scripts/app.min.js" type="text/javascript"></script>
-
-<!-- Global site tag (gtag.js) - Google Analytics -->
-<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122312249-1"></script>
-<script>
-    window.dataLayer = window.dataLayer || [];
-    function gtag(){dataLayer.push(arguments);}
-    gtag('js', new Date());
-
-    gtag('config', 'UA-122312249-1');
-</script>
-
-<!-- END THEME GLOBAL SCRIPTS -->
-<!-- BEGIN THEME LAYOUT SCRIPTS -->
-<!-- END THEME LAYOUT SCRIPTS -->
-</body>
-
-</html>

+ 18 - 18
resources/views/vendor/laravel-log-viewer/log.blade.php

@@ -3,7 +3,7 @@
 <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <title>系统日志</title>
+    <title>系统运行日志</title>
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
     <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css">
     <style>
@@ -54,13 +54,24 @@
         .folder {
             padding-top: 15px;
         }
+
+        .div-scroll {
+            height: 80vh;
+            overflow: hidden auto;
+        }
+
+        .nowrap {
+            white-space: nowrap;
+        }
+
     </style>
 </head>
 <body>
 <div class="container-fluid">
     <div class="row">
         <div class="col sidebar mb-3">
-            <div class="list-group">
+            <h1>系统运行日志</h1>
+            <div class="list-group div-scroll">
                 @foreach($folders as $folder)
                     <div class="list-group-item">
                         <a href="?f={{ \Illuminate\Support\Facades\Crypt::encrypt($folder) }}">
@@ -108,7 +119,7 @@
                     @foreach($logs as $key => $log)
                         <tr data-display="stack{{{$key}}}">
                             @if ($standardFormat)
-                                <td class="text-{{{$log['level_class']}}}">
+                                <td class="nowrap text-{{{$log['level_class']}}}">
                                     <span class="fa fa-{{{$log['level_img']}}}" aria-hidden="true"></span>&nbsp;&nbsp;{{$log['level']}}
                                 </td>
                                 <td class="text">{{$log['context']}}</td>
@@ -137,25 +148,14 @@
             @endif
             <div class="p-3">
                 @if($current_file)
-                    <a href="?dl={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}">
-                        <span class="fa fa-download"></span> 下载
-                    </a>
+                    <a href="?dl={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}"><span class="fa fa-download"></span> Download file </a>
                     -
-                    <a id="clean-log"
-                       href="?clean={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}">
-                        <span class="fa fa-sync"></span> 清空日志
-                    </a>
+                    <a id="clean-log" href="?clean={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}"><span class="fa fa-sync"></span> Clean file </a>
                     -
-                    <a id="delete-log"
-                       href="?del={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}">
-                        <span class="fa fa-trash"></span> 删除日志
-                    </a>
+                    <a id="delete-log" href="?del={{ \Illuminate\Support\Facades\Crypt::encrypt($current_file) }}{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}"><span class="fa fa-trash"></span> Delete file </a>
                     @if(count($files) > 1)
                         -
-                        <a id="delete-all-log"
-                           href="?delall=true{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}">
-                            <span class="fa fa-trash-alt"></span> 删除全部日志
-                        </a>
+                        <a id="delete-all-log" href="?delall=true{{ ($current_folder) ? '&f=' . \Illuminate\Support\Facades\Crypt::encrypt($current_folder) : '' }}"><span class="fa fa-trash-alt"></span> Delete all files </a>
                     @endif
                 @endif
             </div>

+ 36 - 0
resources/views/vendor/pagination/semantic-ui.blade.php

@@ -0,0 +1,36 @@
+@if ($paginator->hasPages())
+    <div class="ui pagination menu" role="navigation">
+        {{-- Previous Page Link --}}
+        @if ($paginator->onFirstPage())
+            <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>
+        @else
+            <a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a>
+        @endif
+
+        {{-- Pagination Elements --}}
+        @foreach ($elements as $element)
+            {{-- "Three Dots" Separator --}}
+            @if (is_string($element))
+                <a class="icon item disabled" aria-disabled="true">{{ $element }}</a>
+            @endif
+
+            {{-- Array Of Links --}}
+            @if (is_array($element))
+                @foreach ($element as $page => $url)
+                    @if ($page == $paginator->currentPage())
+                        <a class="item active" href="{{ $url }}" aria-current="page">{{ $page }}</a>
+                    @else
+                        <a class="item" href="{{ $url }}">{{ $page }}</a>
+                    @endif
+                @endforeach
+            @endif
+        @endforeach
+
+        {{-- Next Page Link --}}
+        @if ($paginator->hasMorePages())
+            <a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>
+        @else
+            <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a>
+        @endif
+    </div>
+@endif

BIN
storage/ipip.ipdb


BIN
storage/qqwry.dat