作者 zhl

init bt

正在显示 72 个修改的文件 包含 4680 行增加0 行删除

要显示太多修改。

为保证性能只显示 72 of 72+ 个文件。

  1 +root = true
  2 +
  3 +[*]
  4 +charset = utf-8
  5 +end_of_line = lf
  6 +insert_final_newline = true
  7 +indent_style = space
  8 +indent_size = 4
  9 +trim_trailing_whitespace = true
  10 +
  11 +[*.md]
  12 +trim_trailing_whitespace = false
  13 +
  14 +[*.{yml,yaml}]
  15 +indent_size = 2
  16 +
  17 +[docker-compose.yml]
  18 +indent_size = 4
  1 +APP_NAME=Laravel
  2 +APP_ENV=local
  3 +APP_KEY=
  4 +APP_DEBUG=true
  5 +APP_URL=http://localhost
  6 +
  7 +LOG_CHANNEL=stack
  8 +LOG_DEPRECATIONS_CHANNEL=null
  9 +LOG_LEVEL=debug
  10 +
  11 +DB_CONNECTION=mysql
  12 +DB_HOST=127.0.0.1
  13 +DB_PORT=3306
  14 +DB_DATABASE=laravel
  15 +DB_USERNAME=root
  16 +DB_PASSWORD=
  17 +
  18 +BROADCAST_DRIVER=log
  19 +CACHE_DRIVER=file
  20 +FILESYSTEM_DRIVER=local
  21 +QUEUE_CONNECTION=sync
  22 +SESSION_DRIVER=file
  23 +SESSION_LIFETIME=120
  24 +
  25 +MEMCACHED_HOST=127.0.0.1
  26 +
  27 +REDIS_HOST=127.0.0.1
  28 +REDIS_PASSWORD=null
  29 +REDIS_PORT=6379
  30 +
  31 +MAIL_MAILER=smtp
  32 +MAIL_HOST=mailhog
  33 +MAIL_PORT=1025
  34 +MAIL_USERNAME=null
  35 +MAIL_PASSWORD=null
  36 +MAIL_ENCRYPTION=null
  37 +MAIL_FROM_ADDRESS=null
  38 +MAIL_FROM_NAME="${APP_NAME}"
  39 +
  40 +AWS_ACCESS_KEY_ID=
  41 +AWS_SECRET_ACCESS_KEY=
  42 +AWS_DEFAULT_REGION=us-east-1
  43 +AWS_BUCKET=
  44 +AWS_USE_PATH_STYLE_ENDPOINT=false
  45 +
  46 +PUSHER_APP_ID=
  47 +PUSHER_APP_KEY=
  48 +PUSHER_APP_SECRET=
  49 +PUSHER_APP_CLUSTER=mt1
  50 +
  51 +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
  52 +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
  1 +* text=auto
  2 +
  3 +*.blade.php diff=html
  4 +*.css diff=css
  5 +*.html diff=html
  6 +*.md diff=markdown
  7 +*.php diff=php
  8 +
  9 +/.github export-ignore
  10 +CHANGELOG.md export-ignore
  1 +/node_modules
  2 +/public/hot
  3 +/public/storage
  4 +/storage/*.key
  5 +/vendor
  6 +.env
  7 +.env.backup
  8 +.phpunit.result.cache
  9 +docker-compose.override.yml
  10 +Homestead.json
  11 +Homestead.yaml
  12 +npm-debug.log
  13 +yarn-error.log
  14 +/.idea
  15 +/.vscode
  16 +/app/Console/Commands/Demo.php
  1 +php:
  2 + preset: laravel
  3 + version: 8
  4 + disabled:
  5 + - no_unused_imports
  6 + finder:
  7 + not-name:
  8 + - index.php
  9 + - server.php
  10 +js:
  11 + finder:
  12 + not-name:
  13 + - webpack.mix.js
  14 +css: true
  1 +<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
  2 +
  3 +<p align="center">
  4 +<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
  5 +<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
  6 +<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
  7 +<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
  8 +</p>
  9 +
  10 +## About Laravel
  11 +
  12 +Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
  13 +
  14 +- [Simple, fast routing engine](https://laravel.com/docs/routing).
  15 +- [Powerful dependency injection container](https://laravel.com/docs/container).
  16 +- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
  17 +- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
  18 +- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
  19 +- [Robust background job processing](https://laravel.com/docs/queues).
  20 +- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
  21 +
  22 +Laravel is accessible, powerful, and provides tools required for large, robust applications.
  23 +
  24 +## Learning Laravel
  25 +
  26 +Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
  27 +
  28 +If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
  29 +
  30 +## Laravel Sponsors
  31 +
  32 +We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
  33 +
  34 +### Premium Partners
  35 +
  36 +- **[Vehikl](https://vehikl.com/)**
  37 +- **[Tighten Co.](https://tighten.co)**
  38 +- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
  39 +- **[64 Robots](https://64robots.com)**
  40 +- **[Cubet Techno Labs](https://cubettech.com)**
  41 +- **[Cyber-Duck](https://cyber-duck.co.uk)**
  42 +- **[Many](https://www.many.co.uk)**
  43 +- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
  44 +- **[DevSquad](https://devsquad.com)**
  45 +- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
  46 +- **[OP.GG](https://op.gg)**
  47 +- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
  48 +- **[Lendio](https://lendio.com)**
  49 +
  50 +## Contributing
  51 +
  52 +Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
  53 +
  54 +## Code of Conduct
  55 +
  56 +In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
  57 +
  58 +## Security Vulnerabilities
  59 +
  60 +If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
  61 +
  62 +## License
  63 +
  64 +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
  1 +<?php
  2 +
  3 +namespace App\Console;
  4 +
  5 +use Illuminate\Console\Scheduling\Schedule;
  6 +use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  7 +
  8 +class Kernel extends ConsoleKernel
  9 +{
  10 + /**
  11 + * Define the application's command schedule.
  12 + *
  13 + * @param \Illuminate\Console\Scheduling\Schedule $schedule
  14 + * @return void
  15 + */
  16 + protected function schedule(Schedule $schedule)
  17 + {
  18 + // $schedule->command('inspire')->hourly();
  19 + }
  20 +
  21 + /**
  22 + * Register the commands for the application.
  23 + *
  24 + * @return void
  25 + */
  26 + protected function commands()
  27 + {
  28 + $this->load(__DIR__.'/Commands');
  29 +
  30 + require base_path('routes/console.php');
  31 + }
  32 +}
  1 +<?php
  2 +
  3 +namespace App\Exceptions;
  4 +
  5 +use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
  6 +use Throwable;
  7 +
  8 +class Handler extends ExceptionHandler
  9 +{
  10 + /**
  11 + * A list of the exception types that are not reported.
  12 + *
  13 + * @var array<int, class-string<Throwable>>
  14 + */
  15 + protected $dontReport = [
  16 + //
  17 + ];
  18 +
  19 + /**
  20 + * A list of the inputs that are never flashed for validation exceptions.
  21 + *
  22 + * @var array<int, string>
  23 + */
  24 + protected $dontFlash = [
  25 + 'current_password',
  26 + 'password',
  27 + 'password_confirmation',
  28 + ];
  29 +
  30 + /**
  31 + * Register the exception handling callbacks for the application.
  32 + *
  33 + * @return void
  34 + */
  35 + public function register()
  36 + {
  37 + $this->reportable(function (Throwable $e) {
  38 + //
  39 + });
  40 + }
  41 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2022/11/2
  6 + * Time: 16:21
  7 + */
  8 +namespace App\Http\Controllers\Api;
  9 +
  10 +use App\Http\Controllers\Controller;
  11 +use App\Models\BtEvents;
  12 +use Illuminate\Http\Request;
  13 +
  14 +/**
  15 + * Class ReceiveControllers
  16 + * @package App\Http\Controllers\Api
  17 + */
  18 +class ReceiveController extends Controller
  19 +{
  20 + /**
  21 + * 接收异步事件
  22 + * @param Request $request
  23 + * @return string
  24 + */
  25 + public function createEvent(Request $request)
  26 + {
  27 + try {
  28 + $type = intval($request->input('type', 0));
  29 + $param = $request->all();
  30 +
  31 + $event_id = BtEvents::createBtEvent($type, json_encode($param));
  32 + return $event_id ? $this->success() : $this->error();
  33 + } catch (\Exception $e) {
  34 + return $this->error($e->getMessage());
  35 + }
  36 + }
  37 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2022/11/1
  6 + * Time: 10:31
  7 + */
  8 +namespace App\Http\Controllers\Api;
  9 +
  10 +use App\Http\Controllers\Controller;
  11 +use App\Repositories\BtRepositories;
  12 +use Illuminate\Http\Request;
  13 +
  14 +/**
  15 + * Class WebSiteControllers
  16 + * @package App\Http\Controllers
  17 + */
  18 +class WebSiteController extends Controller
  19 +{
  20 + /**
  21 + * 创建站点
  22 + * @param Request $request
  23 + * @return string
  24 + */
  25 + public function createSite(Request $request)
  26 + {
  27 + try {
  28 +// $this->validate();
  29 + $domain = $request->input('domain');
  30 + $ssl_open = intval($request->input('ssl_open', 0)) ? 1 : 0;
  31 + $ssl_auto = intval($request->input('ssl_auto', 0)) ? 1 : 0;
  32 + $ssl_auto_day = intval($request->input('ssl_auto_day', 0));
  33 + $ssl_auto_day = $ssl_auto_day > 15 ? 15 : max($ssl_auto_day, 5);
  34 + if (empty($domain) && filter_var($domain, FILTER_VALIDATE_URL))
  35 + return $this->error('请提交有效domain信息');
  36 +
  37 + $result = app(BtRepositories::class)->createBtSite($domain, $ssl_open, $ssl_auto, $ssl_auto_day);
  38 + return $result ? $this->success($result) : $this->error('创建站点失败,提交异步创建任务!');
  39 + } catch (\Exception $e) {
  40 + return $this->error($e->getMessage());
  41 + }
  42 + }
  43 +
  44 + /**
  45 + * 删除站点
  46 + * @param Request $request
  47 + * @return string
  48 + */
  49 + public function deleteSite(Request $request)
  50 + {
  51 + try {
  52 +// $this->validate();
  53 + $domain = $request->input('domain');
  54 + if (empty($domain) && filter_var($domain, FILTER_VALIDATE_URL))
  55 + return $this->error('请提交有效domain信息');
  56 +
  57 + $result = app(BtRepositories::class)->deleteBtSite($domain);
  58 + return $result ? $this->success() : $this->error('删除站点失败,提交异步删除任务!');
  59 + } catch (\Exception $d) {
  60 + return $this->error();
  61 + }
  62 + }
  63 +
  64 + /**
  65 + * 创建站点免费证书
  66 + * @param Request $request
  67 + * @return string
  68 + */
  69 + public function createSsl(Request $request)
  70 + {
  71 + return $this->error();
  72 + }
  73 +
  74 + /**
  75 + * 更新站点免费证书
  76 + * @param Request $request
  77 + * @return string
  78 + */
  79 + public function updateSsl(Request $request)
  80 + {
  81 + return $this->error();
  82 + }
  83 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers;
  4 +
  5 +use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
  6 +use Illuminate\Foundation\Bus\DispatchesJobs;
  7 +use Illuminate\Foundation\Validation\ValidatesRequests;
  8 +use Illuminate\Routing\Controller as BaseController;
  9 +
  10 +class Controller extends BaseController
  11 +{
  12 + use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
  13 +
  14 + /**
  15 + * @param array $data
  16 + * @param string $message
  17 + * @param int $status
  18 + * @return string
  19 + */
  20 + protected function success($data = [], $message = 'success', $status = 200)
  21 + {
  22 + $array = compact('status', 'message', 'data');
  23 + return json_encode($array, JSON_UNESCAPED_UNICODE);
  24 + }
  25 +
  26 + /**
  27 + * @param int $status
  28 + * @param string $message
  29 + * @param array $data
  30 + * @return string
  31 + */
  32 + protected function error($message = 'error', $status = 400, $data = [])
  33 + {
  34 + $array = compact('status', 'message', $data);
  35 + return json_encode($array, JSON_UNESCAPED_UNICODE);
  36 + }
  37 +}
  1 +<?php
  2 +
  3 +namespace App\Http;
  4 +
  5 +use Illuminate\Foundation\Http\Kernel as HttpKernel;
  6 +
  7 +class Kernel extends HttpKernel
  8 +{
  9 + /**
  10 + * The application's global HTTP middleware stack.
  11 + *
  12 + * These middleware are run during every request to your application.
  13 + *
  14 + * @var array<int, class-string|string>
  15 + */
  16 + protected $middleware = [
  17 + // \App\Http\Middleware\TrustHosts::class,
  18 + \App\Http\Middleware\TrustProxies::class,
  19 + \Fruitcake\Cors\HandleCors::class,
  20 + \App\Http\Middleware\PreventRequestsDuringMaintenance::class,
  21 + \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
  22 + \App\Http\Middleware\TrimStrings::class,
  23 + \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
  24 + ];
  25 +
  26 + /**
  27 + * The application's route middleware groups.
  28 + *
  29 + * @var array<string, array<int, class-string|string>>
  30 + */
  31 + protected $middlewareGroups = [
  32 + 'web' => [
  33 + \App\Http\Middleware\EncryptCookies::class,
  34 + \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  35 + \Illuminate\Session\Middleware\StartSession::class,
  36 + // \Illuminate\Session\Middleware\AuthenticateSession::class,
  37 + \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  38 + \App\Http\Middleware\VerifyCsrfToken::class,
  39 + \Illuminate\Routing\Middleware\SubstituteBindings::class,
  40 + ],
  41 +
  42 + 'api' => [
  43 + // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
  44 + 'throttle:api',
  45 + \Illuminate\Routing\Middleware\SubstituteBindings::class,
  46 + ],
  47 + ];
  48 +
  49 + /**
  50 + * The application's route middleware.
  51 + *
  52 + * These middleware may be assigned to groups or used individually.
  53 + *
  54 + * @var array<string, class-string|string>
  55 + */
  56 + protected $routeMiddleware = [
  57 + 'auth' => \App\Http\Middleware\Authenticate::class,
  58 + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  59 + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  60 + 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  61 + 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  62 + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
  63 + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  64 + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  65 + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  66 + ];
  67 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Auth\Middleware\Authenticate as Middleware;
  6 +
  7 +class Authenticate extends Middleware
  8 +{
  9 + /**
  10 + * Get the path the user should be redirected to when they are not authenticated.
  11 + *
  12 + * @param \Illuminate\Http\Request $request
  13 + * @return string|null
  14 + */
  15 + protected function redirectTo($request)
  16 + {
  17 + if (! $request->expectsJson()) {
  18 + return route('login');
  19 + }
  20 + }
  21 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
  6 +
  7 +class EncryptCookies extends Middleware
  8 +{
  9 + /**
  10 + * The names of the cookies that should not be encrypted.
  11 + *
  12 + * @var array<int, string>
  13 + */
  14 + protected $except = [
  15 + //
  16 + ];
  17 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
  6 +
  7 +class PreventRequestsDuringMaintenance extends Middleware
  8 +{
  9 + /**
  10 + * The URIs that should be reachable while maintenance mode is enabled.
  11 + *
  12 + * @var array<int, string>
  13 + */
  14 + protected $except = [
  15 + //
  16 + ];
  17 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use App\Providers\RouteServiceProvider;
  6 +use Closure;
  7 +use Illuminate\Http\Request;
  8 +use Illuminate\Support\Facades\Auth;
  9 +
  10 +class RedirectIfAuthenticated
  11 +{
  12 + /**
  13 + * Handle an incoming request.
  14 + *
  15 + * @param \Illuminate\Http\Request $request
  16 + * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
  17 + * @param string|null ...$guards
  18 + * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
  19 + */
  20 + public function handle(Request $request, Closure $next, ...$guards)
  21 + {
  22 + $guards = empty($guards) ? [null] : $guards;
  23 +
  24 + foreach ($guards as $guard) {
  25 + if (Auth::guard($guard)->check()) {
  26 + return redirect(RouteServiceProvider::HOME);
  27 + }
  28 + }
  29 +
  30 + return $next($request);
  31 + }
  32 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
  6 +
  7 +class TrimStrings extends Middleware
  8 +{
  9 + /**
  10 + * The names of the attributes that should not be trimmed.
  11 + *
  12 + * @var array<int, string>
  13 + */
  14 + protected $except = [
  15 + 'current_password',
  16 + 'password',
  17 + 'password_confirmation',
  18 + ];
  19 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Http\Middleware\TrustHosts as Middleware;
  6 +
  7 +class TrustHosts extends Middleware
  8 +{
  9 + /**
  10 + * Get the host patterns that should be trusted.
  11 + *
  12 + * @return array<int, string|null>
  13 + */
  14 + public function hosts()
  15 + {
  16 + return [
  17 + $this->allSubdomainsOfApplicationUrl(),
  18 + ];
  19 + }
  20 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Http\Middleware\TrustProxies as Middleware;
  6 +use Illuminate\Http\Request;
  7 +
  8 +class TrustProxies extends Middleware
  9 +{
  10 + /**
  11 + * The trusted proxies for this application.
  12 + *
  13 + * @var array<int, string>|string|null
  14 + */
  15 + protected $proxies;
  16 +
  17 + /**
  18 + * The headers that should be used to detect proxies.
  19 + *
  20 + * @var int
  21 + */
  22 + protected $headers =
  23 + Request::HEADER_X_FORWARDED_FOR |
  24 + Request::HEADER_X_FORWARDED_HOST |
  25 + Request::HEADER_X_FORWARDED_PORT |
  26 + Request::HEADER_X_FORWARDED_PROTO |
  27 + Request::HEADER_X_FORWARDED_AWS_ELB;
  28 +}
  1 +<?php
  2 +
  3 +namespace App\Http\Middleware;
  4 +
  5 +use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
  6 +
  7 +class VerifyCsrfToken extends Middleware
  8 +{
  9 + /**
  10 + * The URIs that should be excluded from CSRF verification.
  11 + *
  12 + * @var array<int, string>
  13 + */
  14 + protected $except = [
  15 + //
  16 + ];
  17 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2022/11/03
  6 + * Time: 09:53
  7 + */
  8 +namespace App\Models;
  9 +
  10 +use Illuminate\Database\Eloquent\Model;
  11 +
  12 +/**
  13 + * Class BtEvents
  14 + * @package App\Models
  15 + */
  16 +class BtEvents extends Model
  17 +{
  18 + /**
  19 + * @var string $table
  20 + */
  21 + protected $table = 'bt_events';
  22 +
  23 + const STATUS_INIT = 0;
  24 + const STATUS_FINISH = 1;
  25 + const STATUS_ERROR = 9;
  26 +
  27 + /**
  28 + * @param $type
  29 + * @param $param
  30 + * @return mixed
  31 + */
  32 + public static function createBtEvent($type, $param)
  33 + {
  34 + $event = new self();
  35 + $event->type = $type;
  36 + $event->param = $param;
  37 + $event->save();
  38 + return $event->id;
  39 + }
  40 +}
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2022/11/1
  6 + * Time: 15:44
  7 + */
  8 +namespace App\Models;
  9 +
  10 +use Illuminate\Database\Eloquent\Model;
  11 +
  12 +/**
  13 + * Class BtSites
  14 + * @package App\Models
  15 + */
  16 +class BtSites extends Model
  17 +{
  18 + /**
  19 + * @var string $table
  20 + */
  21 + protected $table = 'bt_sites';
  22 +
  23 + const IS_DEL_FALSE = 0;
  24 + const IS_DEL_TRUE = 1;
  25 +
  26 + const STATUS_OPEN = 1;
  27 + const STATUS_CLOSE = 2;
  28 +
  29 + /**
  30 + * @param $domain
  31 + * @param $site_id
  32 + * @param $ssl_open
  33 + * @param $ssl_status
  34 + * @param $ssl_auto
  35 + * @param $ssl_auto_day
  36 + * @return BtSites
  37 + */
  38 + public static function createBtSite($domain, $site_id, $ssl_open, $ssl_status, $ssl_auto, $ssl_auto_day)
  39 + {
  40 + $site = self::where(['domain' => $domain])->fisrt();
  41 + if (empty($site)) {
  42 + $site = new self();
  43 + }
  44 + $site->domain = $domain;
  45 + $site->site_id = $site_id;
  46 + $site->ssl_open = $ssl_open;
  47 + $site->ssl_status = $ssl_status;
  48 + $site->ssl_auto = $ssl_auto;
  49 + $site->ssl_auto_day = $ssl_auto_day;
  50 + $site->status = self::STATUS_OPEN;
  51 + $site->is_del = self::IS_DEL_FALSE;
  52 + $site->save();
  53 + return $site;
  54 + }
  55 +
  56 + /**
  57 + * @param $domain
  58 + * @return mixed
  59 + */
  60 + public static function getSiteByDomain($domain)
  61 + {
  62 + return self::where(['domain' => $domain, 'is_del' => self::IS_DEL_FALSE])->fisrt();
  63 + }
  64 +}
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Contracts\Auth\MustVerifyEmail;
  6 +use Illuminate\Database\Eloquent\Factories\HasFactory;
  7 +use Illuminate\Foundation\Auth\User as Authenticatable;
  8 +use Illuminate\Notifications\Notifiable;
  9 +use Laravel\Sanctum\HasApiTokens;
  10 +
  11 +class User extends Authenticatable
  12 +{
  13 + use HasApiTokens, HasFactory, Notifiable;
  14 +
  15 + /**
  16 + * The attributes that are mass assignable.
  17 + *
  18 + * @var array<int, string>
  19 + */
  20 + protected $fillable = [
  21 + 'name',
  22 + 'email',
  23 + 'password',
  24 + ];
  25 +
  26 + /**
  27 + * The attributes that should be hidden for serialization.
  28 + *
  29 + * @var array<int, string>
  30 + */
  31 + protected $hidden = [
  32 + 'password',
  33 + 'remember_token',
  34 + ];
  35 +
  36 + /**
  37 + * The attributes that should be cast.
  38 + *
  39 + * @var array<string, string>
  40 + */
  41 + protected $casts = [
  42 + 'email_verified_at' => 'datetime',
  43 + ];
  44 +}
  1 +<?php
  2 +
  3 +namespace App\Providers;
  4 +
  5 +use Illuminate\Support\ServiceProvider;
  6 +
  7 +class AppServiceProvider extends ServiceProvider
  8 +{
  9 + /**
  10 + * Register any application services.
  11 + *
  12 + * @return void
  13 + */
  14 + public function register()
  15 + {
  16 + //
  17 + }
  18 +
  19 + /**
  20 + * Bootstrap any application services.
  21 + *
  22 + * @return void
  23 + */
  24 + public function boot()
  25 + {
  26 + //
  27 + }
  28 +}
  1 +<?php
  2 +
  3 +namespace App\Providers;
  4 +
  5 +use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
  6 +use Illuminate\Support\Facades\Gate;
  7 +
  8 +class AuthServiceProvider extends ServiceProvider
  9 +{
  10 + /**
  11 + * The policy mappings for the application.
  12 + *
  13 + * @var array<class-string, class-string>
  14 + */
  15 + protected $policies = [
  16 + // 'App\Models\Model' => 'App\Policies\ModelPolicy',
  17 + ];
  18 +
  19 + /**
  20 + * Register any authentication / authorization services.
  21 + *
  22 + * @return void
  23 + */
  24 + public function boot()
  25 + {
  26 + $this->registerPolicies();
  27 +
  28 + //
  29 + }
  30 +}
  1 +<?php
  2 +
  3 +namespace App\Providers;
  4 +
  5 +use Illuminate\Support\Facades\Broadcast;
  6 +use Illuminate\Support\ServiceProvider;
  7 +
  8 +class BroadcastServiceProvider extends ServiceProvider
  9 +{
  10 + /**
  11 + * Bootstrap any application services.
  12 + *
  13 + * @return void
  14 + */
  15 + public function boot()
  16 + {
  17 + Broadcast::routes();
  18 +
  19 + require base_path('routes/channels.php');
  20 + }
  21 +}
  1 +<?php
  2 +
  3 +namespace App\Providers;
  4 +
  5 +use Illuminate\Auth\Events\Registered;
  6 +use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
  7 +use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  8 +use Illuminate\Support\Facades\Event;
  9 +
  10 +class EventServiceProvider extends ServiceProvider
  11 +{
  12 + /**
  13 + * The event listener mappings for the application.
  14 + *
  15 + * @var array<class-string, array<int, class-string>>
  16 + */
  17 + protected $listen = [
  18 + Registered::class => [
  19 + SendEmailVerificationNotification::class,
  20 + ],
  21 + ];
  22 +
  23 + /**
  24 + * Register any events for your application.
  25 + *
  26 + * @return void
  27 + */
  28 + public function boot()
  29 + {
  30 + //
  31 + }
  32 +}
  1 +<?php
  2 +
  3 +namespace App\Providers;
  4 +
  5 +use Illuminate\Cache\RateLimiting\Limit;
  6 +use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
  7 +use Illuminate\Http\Request;
  8 +use Illuminate\Support\Facades\RateLimiter;
  9 +use Illuminate\Support\Facades\Route;
  10 +
  11 +class RouteServiceProvider extends ServiceProvider
  12 +{
  13 + /**
  14 + * The path to the "home" route for your application.
  15 + *
  16 + * This is used by Laravel authentication to redirect users after login.
  17 + *
  18 + * @var string
  19 + */
  20 + public const HOME = '/home';
  21 +
  22 + /**
  23 + * The controller namespace for the application.
  24 + *
  25 + * When present, controller route declarations will automatically be prefixed with this namespace.
  26 + *
  27 + * @var string|null
  28 + */
  29 + protected $namespace = 'App\\Http\\Controllers';
  30 +
  31 + /**
  32 + * Define your route model bindings, pattern filters, etc.
  33 + *
  34 + * @return void
  35 + */
  36 + public function boot()
  37 + {
  38 + $this->configureRateLimiting();
  39 +
  40 + $this->routes(function () {
  41 + Route::prefix('api')
  42 + ->middleware('api')
  43 + ->namespace($this->namespace)
  44 + ->group(base_path('routes/api.php'));
  45 +
  46 + Route::middleware('web')
  47 + ->namespace($this->namespace)
  48 + ->group(base_path('routes/web.php'));
  49 + });
  50 + }
  51 +
  52 + /**
  53 + * Configure the rate limiters for the application.
  54 + *
  55 + * @return void
  56 + */
  57 + protected function configureRateLimiting()
  58 + {
  59 + RateLimiter::for('api', function (Request $request) {
  60 + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
  61 + });
  62 + }
  63 +}
  1 +<?php
  2 +namespace App\Repositories\Bt;
  3 +/**
  4 + * 宝塔面板站点操作类库
  5 + * @author 阿良 or Youngxj(二次开发)
  6 + * @link https://www.bt.cn/api-doc.pdf
  7 + * @link https://gitee.com/youngxj0/Bty1.0
  8 + * @version 1.0
  9 + * @example
  10 + * $bt = new Bt('http://127.0.0.1/8888','xxxxxxxxxxxxxxxx');
  11 + * echo $bt->GetSystemTotal();//获取系统基础统计
  12 + * @return Array
  13 + */
  14 +class Bt
  15 +{
  16 + private $BT_KEY = ""; //接口密钥
  17 + private $BT_PANEL = "http://127.0.0.1/8888"; //面板地址
  18 +
  19 + /**
  20 + * 初始化
  21 + * @param [type] $bt_panel 宝塔接口地址
  22 + * @param [type] $bt_key 宝塔Api密钥
  23 + */
  24 + public function __construct($bt_panel = null,$bt_key = null){
  25 + if($bt_panel) $this->BT_PANEL = $bt_panel;
  26 + if($bt_key) $this->BT_KEY = $bt_key;
  27 + }
  28 +
  29 + /**
  30 + * 获取系统基础统计
  31 + */
  32 + public function GetSystemTotal(){
  33 + $url = $this->BT_PANEL.$this->config("GetSystemTotal");
  34 +
  35 + $p_data = $this->GetKeyData();
  36 +
  37 + $result = $this->HttpPostCookie($url,$p_data);
  38 +
  39 + $data = json_decode($result,true);
  40 + return $data;
  41 + }
  42 +
  43 + /**
  44 + * 获取磁盘分区信息
  45 + */
  46 + public function GetDiskInfo(){
  47 + $url = $this->BT_PANEL.$this->config("GetDiskInfo");
  48 +
  49 + $p_data = $this->GetKeyData();
  50 +
  51 + $result = $this->HttpPostCookie($url,$p_data);
  52 +
  53 + $data = json_decode($result,true);
  54 + return $data;
  55 + }
  56 +
  57 + /**
  58 + * 获取实时状态信息
  59 + * (CPU、内存、网络、负载)
  60 + */
  61 + public function GetNetWork(){
  62 + $url = $this->BT_PANEL.$this->config("GetNetWork");
  63 +
  64 + $p_data = $this->GetKeyData();
  65 +
  66 + $result = $this->HttpPostCookie($url,$p_data);
  67 +
  68 + $data = json_decode($result,true);
  69 + return $data;
  70 + }
  71 +
  72 + /**
  73 + * 检查是否有安装任务
  74 + */
  75 + public function GetTaskCount(){
  76 + $url = $this->BT_PANEL.$this->config("GetTaskCount");
  77 +
  78 + $p_data = $this->GetKeyData();
  79 +
  80 + $result = $this->HttpPostCookie($url,$p_data);
  81 +
  82 + $data = json_decode($result,true);
  83 + return $data;
  84 + }
  85 +
  86 + /**
  87 + * 检查面板更新
  88 + */
  89 + public function UpdatePanel($check=false,$force=false){
  90 + $url = $this->BT_PANEL.$this->config("UpdatePanel");
  91 +
  92 + $p_data = $this->GetKeyData();
  93 + $p_data['check'] = $check;
  94 + $p_data['force'] = $force;
  95 +
  96 + $result = $this->HttpPostCookie($url,$p_data);
  97 +
  98 + $data = json_decode($result,true);
  99 + return $data;
  100 + }
  101 + /**
  102 + * 申请ssl
  103 + */
  104 + public function ApplyCert($domains,$id){
  105 + $url = $this->BT_PANEL.$this->config("ApplyCert");
  106 + $p_data = $this->GetKeyData();
  107 + $p_data['domains'] = $domains;
  108 + $p_data['auth_type'] = "http";
  109 + $p_data['auth_to'] = $id;
  110 + $p_data['auto_wildcard'] = 0;
  111 + $p_data['id'] = $id;
  112 + $result = $this->HttpPostCookie($url,$p_data);
  113 +
  114 + $data = json_decode($result,true);
  115 + return $data;
  116 + }
  117 + /**
  118 + * 续签ssl
  119 + */
  120 + public function RenewCert($index){
  121 + $url = $this->BT_PANEL.$this->config("RenewCert");
  122 + $p_data = $this->GetKeyData();
  123 +
  124 + $p_data['index'] = $index;
  125 +
  126 + $result = $this->HttpPostCookie($url,$p_data);
  127 + $data = json_decode($result,true);
  128 + return $data;
  129 + }
  130 +
  131 +
  132 +
  133 + /**
  134 + * 获取网站列表
  135 + * @param string $page 当前分页
  136 + * @param string $limit 取出的数据行数
  137 + * @param string $type 分类标识 -1: 分部分类 0: 默认分类
  138 + * @param string $order 排序规则 使用 id 降序:id desc 使用名称升序:name desc
  139 + * @param string $tojs 分页 JS 回调,若不传则构造 URI 分页连接
  140 + * @param string $search 搜索内容
  141 + */
  142 + public function Websites($search='',$page='1',$limit='15',$type='-1',$order='id desc',$tojs=''){
  143 + $url = $this->BT_PANEL.$this->config("Websites");
  144 +
  145 + $p_data = $this->GetKeyData();
  146 + $p_data['p'] = $page;
  147 + $p_data['limit'] = $limit;
  148 + $p_data['type'] = $type;
  149 + $p_data['order'] = $order;
  150 + $p_data['tojs'] = $tojs;
  151 + $p_data['search'] = $search;
  152 +
  153 + $result = $this->HttpPostCookie($url,$p_data);
  154 +
  155 + $data = json_decode($result,true);
  156 + return $data;
  157 + }
  158 +
  159 + /**
  160 + * 获取网站FTP列表
  161 + * @param string $page 当前分页
  162 + * @param string $limit 取出的数据行数
  163 + * @param string $type 分类标识 -1: 分部分类 0: 默认分类
  164 + * @param string $order 排序规则 使用 id 降序:id desc 使用名称升序:name desc
  165 + * @param string $tojs 分页 JS 回调,若不传则构造 URI 分页连接
  166 + * @param string $search 搜索内容
  167 + */
  168 + public function WebFtpList($search='',$page='1',$limit='15',$type='-1',$order='id desc',$tojs=''){
  169 + $url = $this->BT_PANEL.$this->config("WebFtpList");
  170 +
  171 + $p_data = $this->GetKeyData();
  172 + $p_data['p'] = $page;
  173 + $p_data['limit'] = $limit;
  174 + $p_data['type'] = $type;
  175 + $p_data['order'] = $order;
  176 + $p_data['tojs'] = $tojs;
  177 + $p_data['search'] = $search;
  178 +
  179 + $result = $this->HttpPostCookie($url,$p_data);
  180 +
  181 + $data = json_decode($result,true);
  182 + return $data;
  183 + }
  184 +
  185 + /**
  186 + * 获取网站SQL列表
  187 + * @param string $page 当前分页
  188 + * @param string $limit 取出的数据行数
  189 + * @param string $type 分类标识 -1: 分部分类 0: 默认分类
  190 + * @param string $order 排序规则 使用 id 降序:id desc 使用名称升序:name desc
  191 + * @param string $tojs 分页 JS 回调,若不传则构造 URI 分页连接
  192 + * @param string $search 搜索内容
  193 + */
  194 + public function WebSqlList($search='',$page='1',$limit='15',$type='-1',$order='id desc',$tojs=''){
  195 + $url = $this->BT_PANEL.$this->config("WebSqlList");
  196 +
  197 + $p_data = $this->GetKeyData();
  198 + $p_data['p'] = $page;
  199 + $p_data['limit'] = $limit;
  200 + $p_data['type'] = $type;
  201 + $p_data['order'] = $order;
  202 + $p_data['tojs'] = $tojs;
  203 + $p_data['search'] = $search;
  204 +
  205 + $result = $this->HttpPostCookie($url,$p_data);
  206 +
  207 + $data = json_decode($result,true);
  208 + return $data;
  209 + }
  210 +
  211 + /**
  212 + * 获取所有网站分类
  213 + */
  214 + public function Webtypes(){
  215 + $url = $this->BT_PANEL.$this->config("Webtypes");
  216 +
  217 + $p_data = $this->GetKeyData();
  218 +
  219 + $result = $this->HttpPostCookie($url,$p_data);
  220 +
  221 + $data = json_decode($result,true);
  222 + return $data;
  223 + }
  224 +
  225 + /**
  226 + * 获取已安装的 PHP 版本列表
  227 + */
  228 + public function GetPHPVersion(){
  229 + //拼接URL地址
  230 + $url = $this->BT_PANEL.$this->config("GetPHPVersion");
  231 +
  232 + //准备POST数据
  233 + $p_data = $this->GetKeyData(); //取签名
  234 +
  235 + //请求面板接口
  236 + $result = $this->HttpPostCookie($url,$p_data);
  237 +
  238 + //解析JSON数据
  239 + $data = json_decode($result,true);
  240 +
  241 + return $data;
  242 + }
  243 +
  244 + /**
  245 + * 修改指定网站的PHP版本
  246 + * @param [type] $site 网站名
  247 + * @param [type] $php PHP版本
  248 + */
  249 + public function SetPHPVersion($site,$php){
  250 +
  251 + $url = $this->BT_PANEL.$this->config("SetPHPVersion");
  252 +
  253 + $p_data = $this->GetKeyData();
  254 + $p_data['siteName'] = $site;
  255 + $p_data['version'] = $php;
  256 + $result = $this->HttpPostCookie($url,$p_data);
  257 +
  258 + $data = json_decode($result,true);
  259 + return $data;
  260 + }
  261 +
  262 + /**
  263 + * 获取指定网站运行的PHP版本
  264 + * @param [type] $site 网站名
  265 + */
  266 + public function GetSitePHPVersion($site){
  267 + $url = $this->BT_PANEL.$this->config("GetSitePHPVersion");
  268 +
  269 + $p_data = $this->GetKeyData();
  270 + $p_data['siteName'] = $site;
  271 + $result = $this->HttpPostCookie($url,$p_data);
  272 +
  273 + $data = json_decode($result,true);
  274 + return $data;
  275 + }
  276 +
  277 +
  278 + /**
  279 + * 新增网站
  280 + * @param [type] $webname 网站域名 json格式
  281 + * @param [type] $path 网站路径
  282 + * @param [type] $type_id 网站分类ID
  283 + * @param string $type 网站类型
  284 + * @param [type] $version PHP版本
  285 + * @param [type] $port 网站端口
  286 + * @param [type] $ps 网站备注
  287 + * @param [type] $ftp 网站是否开通FTP
  288 + * @param [type] $ftp_username FTP用户名
  289 + * @param [type] $ftp_password FTP密码
  290 + * @param [type] $sql 网站是否开通数据库
  291 + * @param [type] $codeing 数据库编码类型 utf8|utf8mb4|gbk|big5
  292 + * @param [type] $datauser 数据库账号
  293 + * @param [type] $datapassword 数据库密码
  294 + */
  295 + public function AddSite($infoArr=[]){
  296 + $url = $this->BT_PANEL.$this->config("WebAddSite");
  297 + //准备POST数据
  298 + $p_data = $this->GetKeyData(); //取签名
  299 + $p_data['webname'] = $infoArr['webname'];
  300 + $p_data['path'] = $infoArr['path'];
  301 + $p_data['type_id'] = $infoArr['type_id'];
  302 + $p_data['type'] = $infoArr['type'];
  303 + $p_data['version'] = $infoArr['version'];
  304 + $p_data['port'] = $infoArr['port'];
  305 + $p_data['ps'] = $infoArr['ps'];
  306 + $p_data['ftp'] = $infoArr['ftp'];
  307 + $p_data['ftp_username'] = $infoArr['ftp_username'];
  308 + $p_data['ftp_password'] = $infoArr['ftp_password'];
  309 + $p_data['sql'] = $infoArr['sql'];
  310 + $p_data['codeing'] = $infoArr['codeing'];
  311 + $p_data['datauser'] = $infoArr['datauser'];
  312 + $p_data['datapassword'] = $infoArr['datapassword'];
  313 +
  314 +
  315 +
  316 + //请求面板接口
  317 + $result = $this->HttpPostCookie($url,$p_data);
  318 + //var_dump($result);
  319 + //解析JSON数据
  320 + $data = json_decode($result,true);
  321 + return $data;
  322 + }
  323 +
  324 + /**
  325 + * 删除网站
  326 + * @param [type] $id 网站ID
  327 + * @param [type] $webname 网站名称
  328 + * @param [type] $ftp 是否删除关联FTP
  329 + * @param [type] $database 是否删除关联数据库
  330 + * @param [type] $path 是否删除关联网站根目录
  331 + *
  332 + */
  333 + public function WebDeleteSite($id,$webname,$ftp,$database,$path){
  334 + $url = $this->BT_PANEL.$this->config("WebDeleteSite");
  335 +
  336 + $p_data = $this->GetKeyData();
  337 + $p_data['id'] = $id;
  338 + $p_data['webname'] = $webname;
  339 + $p_data['ftp'] = $ftp;
  340 + $p_data['database'] = $database;
  341 + $p_data['path'] = $path;
  342 +
  343 + $result = $this->HttpPostCookie($url,$p_data);
  344 +
  345 + $data = json_decode($result,true);
  346 + return $data;
  347 + }
  348 +
  349 + /**
  350 + * 停用站点
  351 + * @param [type] $id 网站ID
  352 + * @param [type] $name 网站域名
  353 + */
  354 + public function WebSiteStop($id,$name){
  355 + $url = $this->BT_PANEL.$this->config("WebSiteStop");
  356 +
  357 + $p_data = $this->GetKeyData();
  358 + $p_data['id'] = $id;
  359 + $p_data['name'] = $name;
  360 + $result = $this->HttpPostCookie($url,$p_data);
  361 +
  362 + $data = json_decode($result,true);
  363 + return $data;
  364 + }
  365 +
  366 + /**
  367 + * 启用网站
  368 + * @param [type] $id 网站ID
  369 + * @param [type] $name 网站域名
  370 + */
  371 + public function WebSiteStart($id,$name){
  372 + $url = $this->BT_PANEL.$this->config("WebSiteStart");
  373 +
  374 + $p_data = $this->GetKeyData();
  375 + $p_data['id'] = $id;
  376 + $p_data['name'] = $name;
  377 + $result = $this->HttpPostCookie($url,$p_data);
  378 +
  379 + $data = json_decode($result,true);
  380 + return $data;
  381 + }
  382 +
  383 + /**
  384 + * 设置网站到期时间
  385 + * @param [type] $id 网站ID
  386 + * @param [type] $edate 网站到期时间 格式:2019-01-01,永久:0000-00-00
  387 + */
  388 + public function WebSetEdate($id,$edate){
  389 + $url = $this->BT_PANEL.$this->config("WebSetEdate");
  390 +
  391 + $p_data = $this->GetKeyData();
  392 + $p_data['id'] = $id;
  393 + $p_data['edate'] = $edate;
  394 + $result = $this->HttpPostCookie($url,$p_data);
  395 +
  396 + $data = json_decode($result,true);
  397 + return $data;
  398 + }
  399 +
  400 + /**
  401 + * 修改网站备注
  402 + * @param [type] $id 网站ID
  403 + * @param [type] $ps 网站备注
  404 + */
  405 + public function WebSetPs($id,$ps){
  406 + $url = $this->BT_PANEL.$this->config("WebSetPs");
  407 +
  408 + $p_data = $this->GetKeyData();
  409 + $p_data['id'] = $id;
  410 + $p_data['ps'] = $ps;
  411 + $result = $this->HttpPostCookie($url,$p_data);
  412 +
  413 + $data = json_decode($result,true);
  414 + return $data;
  415 + }
  416 +
  417 + /**
  418 + * 获取网站备份列表
  419 + * @param [type] $id 网站ID
  420 + * @param string $page 当前分页
  421 + * @param string $limit 每页取出的数据行数
  422 + * @param string $type 备份类型 目前固定为0
  423 + * @param string $tojs 分页js回调若不传则构造 URI 分页连接 get_site_backup
  424 + */
  425 + public function WebBackupList($id,$page='1',$limit='5',$type='0',$tojs=''){
  426 + $url = $this->BT_PANEL.$this->config("WebBackupList");
  427 +
  428 + $p_data = $this->GetKeyData();
  429 + $p_data['p'] = $page;
  430 + $p_data['limit'] = $limit;
  431 + $p_data['type'] = $type;
  432 + $p_data['tojs'] = $tojs;
  433 + $p_data['search'] = $id;
  434 + $result = $this->HttpPostCookie($url,$p_data);
  435 +
  436 + $data = json_decode($result,true);
  437 + return $data;
  438 + }
  439 +
  440 + /**
  441 + * 创建网站备份
  442 + * @param [type] $id 网站ID
  443 + */
  444 + public function WebToBackup($id){
  445 + $url = $this->BT_PANEL.$this->config("WebToBackup");
  446 +
  447 + $p_data = $this->GetKeyData();
  448 + $p_data['id'] = $id;
  449 + $result = $this->HttpPostCookie($url,$p_data);
  450 +
  451 + $data = json_decode($result,true);
  452 + return $data;
  453 + }
  454 +
  455 + /**
  456 + * 删除网站备份
  457 + * @param [type] $id 网站备份ID
  458 + */
  459 + public function WebDelBackup($id){
  460 + $url = $this->BT_PANEL.$this->config("WebDelBackup");
  461 +
  462 + $p_data = $this->GetKeyData();
  463 + $p_data['id'] = $id;
  464 + $result = $this->HttpPostCookie($url,$p_data);
  465 +
  466 + $data = json_decode($result,true);
  467 + return $data;
  468 + }
  469 +
  470 + /**
  471 + * 删除数据库备份
  472 + * @param [type] $id 数据库备份ID
  473 + */
  474 + public function SQLDelBackup($id){
  475 + $url = $this->BT_PANEL.$this->config("SQLDelBackup");
  476 +
  477 + $p_data = $this->GetKeyData();
  478 + $p_data['id'] = $id;
  479 + $result = $this->HttpPostCookie($url,$p_data);
  480 +
  481 + $data = json_decode($result,true);
  482 + return $data;
  483 + }
  484 +
  485 + /**
  486 + * 备份数据库
  487 + * @param [type] $id 数据库列表ID
  488 + */
  489 + public function SQLToBackup($id){
  490 + $url = $this->BT_PANEL.$this->config("SQLToBackup");
  491 +
  492 + $p_data = $this->GetKeyData();
  493 + $p_data['id'] = $id;
  494 + $result = $this->HttpPostCookie($url,$p_data);
  495 +
  496 + $data = json_decode($result,true);
  497 + return $data;
  498 + }
  499 +
  500 + /**
  501 + * 获取网站域名列表
  502 + * @param [type] $id 网站ID
  503 + * @param boolean $list 固定传true
  504 + */
  505 + public function WebDoaminList($id,$list=true){
  506 + $url = $this->BT_PANEL.$this->config("WebDoaminList");
  507 +
  508 + $p_data = $this->GetKeyData();
  509 + $p_data['search'] = $id;
  510 + $p_data['list'] = $list;
  511 + $result = $this->HttpPostCookie($url,$p_data);
  512 +
  513 + $data = json_decode($result,true);
  514 + return $data;
  515 + }
  516 +
  517 + /**
  518 + * 添加域名
  519 + * @param [type] $id 网站ID
  520 + * @param [type] $webname 网站名称
  521 + * @param [type] $domain 要添加的域名:端口 80 端品不必构造端口,多个域名用换行符隔开
  522 + */
  523 + public function WebAddDomain($id,$webname,$domain){
  524 + $url = $this->BT_PANEL.$this->config("WebAddDomain");
  525 +
  526 + $p_data = $this->GetKeyData();
  527 + $p_data['id'] = $id;
  528 + $p_data['webname'] = $webname;
  529 + $p_data['domain'] = $domain;
  530 + $result = $this->HttpPostCookie($url,$p_data);
  531 +
  532 + $data = json_decode($result,true);
  533 + return $data;
  534 + }
  535 +
  536 + /**
  537 + * 删除网站域名
  538 + * @param [type] $id 网站ID
  539 + * @param [type] $webname 网站名
  540 + * @param [type] $domain 网站域名
  541 + * @param [type] $port 网站域名端口
  542 + */
  543 + public function WebDelDomain($id,$webname,$domain,$port){
  544 + $url = $this->BT_PANEL.$this->config("WebDelDomain");
  545 +
  546 + $p_data = $this->GetKeyData();
  547 + $p_data['id'] = $id;
  548 + $p_data['webname'] = $webname;
  549 + $p_data['domain'] = $domain;
  550 + $p_data['port'] = $port;
  551 + $result = $this->HttpPostCookie($url,$p_data);
  552 +
  553 + $data = json_decode($result,true);
  554 + return $data;
  555 + }
  556 +
  557 + /**
  558 + * 获取可选的预定义伪静态列表
  559 + * @param [type] $siteName 网站名
  560 + */
  561 + public function GetRewriteList($siteName){
  562 + $url = $this->BT_PANEL.$this->config("GetRewriteList");
  563 +
  564 + $p_data = $this->GetKeyData();
  565 + $p_data['siteName'] = $siteName;
  566 + $result = $this->HttpPostCookie($url,$p_data);
  567 +
  568 + $data = json_decode($result,true);
  569 + return $data;
  570 + }
  571 +
  572 + /**
  573 + * 获取预置伪静态规则内容(文件内容)
  574 + * @param [type] $path 规则名
  575 + * @param [type] $type 0->获取内置伪静态规则;1->获取当前站点伪静态规则
  576 + */
  577 + public function GetFileBody($path,$type=0){
  578 + $url = $this->BT_PANEL.$this->config("GetFileBody");
  579 + $p_data = $this->GetKeyData();
  580 + $path_dir = $type?'vhost/rewrite':'rewrite/nginx';
  581 +
  582 + //获取当前站点伪静态规则
  583 + ///www/server/panel/vhost/rewrite/user_hvVBT_1.test.com.conf
  584 + //获取内置伪静态规则
  585 + ///www/server/panel/rewrite/nginx/EmpireCMS.conf
  586 + //保存伪静态规则到站点
  587 + ///www/server/panel/vhost/rewrite/user_hvVBT_1.test.com.conf
  588 + ///www/server/panel/rewrite/nginx/typecho.conf
  589 + $p_data['path'] = '/www/server/panel/'.$path_dir.'/'.$path.'.conf';
  590 + //var_dump($p_data['path']);
  591 + $result = $this->HttpPostCookie($url,$p_data);
  592 +
  593 + $data = json_decode($result,true);
  594 + return $data;
  595 + }
  596 +
  597 + /**
  598 + * 保存伪静态规则内容(保存文件内容)
  599 + * @param [type] $path 规则名
  600 + * @param [type] $data 规则内容
  601 + * @param string $encoding 规则编码强转utf-8
  602 + * @param number $type 0->系统默认路径;1->自定义全路径
  603 + */
  604 + public function SaveFileBody($path,$data,$encoding='utf-8',$type=0){
  605 + $url = $this->BT_PANEL.$this->config("SaveFileBody");
  606 + if($type){
  607 + $path_dir = $path;
  608 + }else{
  609 + $path_dir = '/www/server/panel/vhost/rewrite/'.$path.'.conf';
  610 + }
  611 + $p_data = $this->GetKeyData();
  612 + $p_data['path'] = $path_dir;
  613 + $p_data['data'] = $data;
  614 + $p_data['encoding'] = $encoding;
  615 + $result = $this->HttpPostCookie($url,$p_data);
  616 +
  617 + $data = json_decode($result,true);
  618 + return $data;
  619 + }
  620 +
  621 +
  622 +
  623 + /**
  624 + * 设置密码访问网站
  625 + * @param [type] $id 网站ID
  626 + * @param [type] $username 用户名
  627 + * @param [type] $password 密码
  628 + */
  629 + public function SetHasPwd($id,$username,$password){
  630 + $url = $this->BT_PANEL.$this->config("SetHasPwd");
  631 +
  632 + $p_data = $this->GetKeyData();
  633 + $p_data['id'] = $id;
  634 + $p_data['username'] = $username;
  635 + $p_data['password'] = $password;
  636 + $result = $this->HttpPostCookie($url,$p_data);
  637 +
  638 + $data = json_decode($result,true);
  639 + return $data;
  640 + }
  641 +
  642 + /**
  643 + * 关闭密码访问网站
  644 + * @param [type] $id 网站ID
  645 + */
  646 + public function CloseHasPwd($id){
  647 + $url = $this->BT_PANEL.$this->config("CloseHasPwd");
  648 +
  649 + $p_data = $this->GetKeyData();
  650 + $p_data['id'] = $id;
  651 + $result = $this->HttpPostCookie($url,$p_data);
  652 +
  653 + $data = json_decode($result,true);
  654 + return $data;
  655 + }
  656 +
  657 + /**
  658 + * 获取网站日志
  659 + * @param [type] $site 网站名
  660 + */
  661 + public function GetSiteLogs($site){
  662 + $url = $this->BT_PANEL.$this->config("GetSiteLogs");
  663 +
  664 + $p_data = $this->GetKeyData();
  665 + $p_data['siteName'] = $site;
  666 + $result = $this->HttpPostCookie($url,$p_data);
  667 +
  668 + $data = json_decode($result,true);
  669 + return $data;
  670 + }
  671 +
  672 + /**
  673 + * 获取网站盗链状态及规则信息
  674 + * @param [type] $id 网站ID
  675 + * @param [type] $site 网站名
  676 + */
  677 + public function GetSecurity($id,$site){
  678 + $url = $this->BT_PANEL.$this->config("GetSecurity");
  679 +
  680 + $p_data = $this->GetKeyData();
  681 + $p_data['id'] = $id;
  682 + $p_data['name'] = $site;
  683 + $result = $this->HttpPostCookie($url,$p_data);
  684 +
  685 + $data = json_decode($result,true);
  686 + return $data;
  687 + }
  688 +
  689 + /**
  690 + * 设置网站盗链状态及规则信息
  691 + * @param [type] $id 网站ID
  692 + * @param [type] $site 网站名
  693 + * @param [type] $fix URL后缀
  694 + * @param [type] $domains 许可域名
  695 + * @param [type] $status 状态
  696 + */
  697 + public function SetSecurity($id,$site,$fix,$domains,$status){
  698 + $url = $this->BT_PANEL.$this->config("SetSecurity");
  699 +
  700 + $p_data = $this->GetKeyData();
  701 + $p_data['id'] = $id;
  702 + $p_data['name'] = $site;
  703 + $p_data['fix'] = $fix;
  704 + $p_data['domains'] = $domains;
  705 + $p_data['status'] = $status;
  706 + $result = $this->HttpPostCookie($url,$p_data);
  707 +
  708 + $data = json_decode($result,true);
  709 + return $data;
  710 + }
  711 +
  712 + /**
  713 + * 获取网站三项配置开关(防跨站、日志、密码访问)
  714 + * @param [type] $id 网站ID
  715 + * @param [type] $path 网站运行目录
  716 + */
  717 + public function GetDirUserINI($id,$path){
  718 + $url = $this->BT_PANEL.$this->config("GetDirUserINI");
  719 +
  720 + $p_data = $this->GetKeyData();
  721 + $p_data['id'] = $id;
  722 + $p_data['path'] = $path;
  723 + $result = $this->HttpPostCookie($url,$p_data);
  724 +
  725 + $data = json_decode($result,true);
  726 + return $data;
  727 + }
  728 +
  729 + /**
  730 + * 开启强制HTTPS
  731 + * @param [type] $site 网站域名(纯域名)
  732 + */
  733 + public function HttpToHttps($site){
  734 + $url = $this->BT_PANEL.$this->config("HttpToHttps");
  735 +
  736 + $p_data = $this->GetKeyData();
  737 + $p_data['siteName'] = $site;
  738 + $result = $this->HttpPostCookie($url,$p_data);
  739 +
  740 + $data = json_decode($result,true);
  741 + return $data;
  742 + }
  743 +
  744 + /**
  745 + * 关闭强制HTTPS
  746 + * @param [type] $site 域名(纯域名)
  747 + */
  748 + public function CloseToHttps($site){
  749 + $url = $this->BT_PANEL.$this->config("CloseToHttps");
  750 +
  751 + $p_data = $this->GetKeyData();
  752 + $p_data['siteName'] = $site;
  753 + $result = $this->HttpPostCookie($url,$p_data);
  754 +
  755 + $data = json_decode($result,true);
  756 + return $data;
  757 + }
  758 +
  759 + /**
  760 + * 设置SSL域名证书
  761 + * @param [type] $type 类型
  762 + * @param [type] $site 网站名
  763 + * @param [type] $key 证书key
  764 + * @param [type] $csr 证书PEM
  765 + */
  766 + public function SetSSL($type,$site,$key,$csr){
  767 + $url = $this->BT_PANEL.$this->config("SetSSL");
  768 +
  769 + $p_data = $this->GetKeyData();
  770 + $p_data['type'] = $type;
  771 + $p_data['siteName'] = $site;
  772 + $p_data['key'] = $key;
  773 + $p_data['csr'] = $csr;
  774 + $result = $this->HttpPostCookie($url,$p_data);
  775 +
  776 + $data = json_decode($result,true);
  777 + return $data;
  778 +
  779 + }
  780 +
  781 + /**
  782 + * 关闭SSL
  783 + * @param [type] $updateOf 修改状态码
  784 + * @param [type] $site 域名(纯域名)
  785 + */
  786 + public function CloseSSLConf($updateOf,$site){
  787 + $url = $this->BT_PANEL.$this->config("CloseSSLConf");
  788 +
  789 + $p_data = $this->GetKeyData();
  790 + $p_data['updateOf'] = $updateOf;
  791 + $p_data['siteName'] = $site;
  792 + $result = $this->HttpPostCookie($url,$p_data);
  793 +
  794 + $data = json_decode($result,true);
  795 + return $data;
  796 + }
  797 +
  798 + /**
  799 + * 获取SSL状态及证书信息
  800 + * @param [type] $site 域名(纯域名)
  801 + */
  802 + public function GetSSL($site){
  803 + $url = $this->BT_PANEL.$this->config("GetSSL");
  804 +
  805 + $p_data = $this->GetKeyData();
  806 + $p_data['siteName'] = $site;
  807 + $result = $this->HttpPostCookie($url,$p_data);
  808 +
  809 + $data = json_decode($result,true);
  810 + return $data;
  811 + }
  812 +
  813 + /**
  814 + * 获取网站默认文件
  815 + * @param [type] $id 网站ID
  816 + */
  817 + public function WebGetIndex($id){
  818 + $url = $this->BT_PANEL.$this->config("WebGetIndex");
  819 +
  820 + $p_data = $this->GetKeyData();
  821 + $p_data['id'] = $id;
  822 + $result = $this->HttpPostCookie($url,$p_data);
  823 +
  824 + $data = json_decode($result,true);
  825 + return $data;
  826 + }
  827 +
  828 + /**
  829 + * 设置网站默认文件
  830 + * @param [type] $id 网站ID
  831 + * @param [type] $index 内容
  832 + */
  833 + public function WebSetIndex($id,$index){
  834 + $url = $this->BT_PANEL.$this->config("WebSetIndex");
  835 +
  836 + $p_data = $this->GetKeyData();
  837 + $p_data['id'] = $id;
  838 + $p_data['Index'] = $index;
  839 + $result = $this->HttpPostCookie($url,$p_data);
  840 +
  841 + $data = json_decode($result,true);
  842 + return $data;
  843 + }
  844 +
  845 + /**
  846 + * 获取网站流量限制信息
  847 + * @param [type] $id [description]
  848 + */
  849 + public function GetLimitNet($id){
  850 + $url = $this->BT_PANEL.$this->config("GetLimitNet");
  851 +
  852 + $p_data = $this->GetKeyData();
  853 + $p_data['id'] = $id;
  854 + $result = $this->HttpPostCookie($url,$p_data);
  855 +
  856 + $data = json_decode($result,true);
  857 + return $data;
  858 + }
  859 +
  860 + /**
  861 + * 设置网站流量限制信息
  862 + * @param [type] $id 网站ID
  863 + * @param [type] $perserver 并发限制
  864 + * @param [type] $perip 单IP限制
  865 + * @param [type] $limit_rate 流量限制
  866 + */
  867 + public function SetLimitNet($id,$perserver,$perip,$limit_rate){
  868 + $url = $this->BT_PANEL.$this->config("SetLimitNet");
  869 +
  870 + $p_data = $this->GetKeyData();
  871 + $p_data['id'] = $id;
  872 + $p_data['perserver'] = $perserver;
  873 + $p_data['perip'] = $perip;
  874 + $p_data['limit_rate'] = $limit_rate;
  875 + $result = $this->HttpPostCookie($url,$p_data);
  876 +
  877 + $data = json_decode($result,true);
  878 + return $data;
  879 + }
  880 +
  881 + /**
  882 + * 关闭网站流量限制
  883 + * @param [type] $id 网站ID
  884 + */
  885 + public function CloseLimitNet($id){
  886 + $url = $this->BT_PANEL.$this->config("CloseLimitNet");
  887 +
  888 + $p_data = $this->GetKeyData();
  889 + $p_data['id'] = $id;
  890 + $result = $this->HttpPostCookie($url,$p_data);
  891 +
  892 + $data = json_decode($result,true);
  893 + return $data;
  894 + }
  895 +
  896 + /**
  897 + * 获取网站301重定向信息
  898 + * @param [type] $site 网站名
  899 + */
  900 + public function Get301Status($site){
  901 + $url = $this->BT_PANEL.$this->config("Get301Status");
  902 +
  903 + $p_data = $this->GetKeyData();
  904 + $p_data['siteName'] = $site;
  905 + $result = $this->HttpPostCookie($url,$p_data);
  906 +
  907 + $data = json_decode($result,true);
  908 + return $data;
  909 + }
  910 +
  911 + /**
  912 + * 设置网站301重定向信息
  913 + * @param [type] $site 网站名
  914 + * @param [type] $toDomain 目标Url
  915 + * @param [type] $srcDomain 来自Url
  916 + * @param [type] $type 类型
  917 + */
  918 + public function Set301Status($site,$toDomain,$srcDomain,$type){
  919 + $url = $this->BT_PANEL.$this->config("Set301Status");
  920 +
  921 + $p_data = $this->GetKeyData();
  922 + $p_data['siteName'] = $site;
  923 + $p_data['toDomain'] = $toDomain;
  924 + $p_data['srcDomain'] = $srcDomain;
  925 + $p_data['type'] = $type;
  926 + $result = $this->HttpPostCookie($url,$p_data);
  927 +
  928 + $data = json_decode($result,true);
  929 + return $data;
  930 + }
  931 +
  932 + /**
  933 + * 获取网站反代信息及状态
  934 + * @param [type] $site [description]
  935 + */
  936 + public function GetProxyList($site){
  937 + $url = $this->BT_PANEL.$this->config("GetProxyList");
  938 +
  939 + $p_data = $this->GetKeyData();
  940 + $p_data['sitename'] = $site;
  941 + $result = $this->HttpPostCookie($url,$p_data);
  942 +
  943 + $data = json_decode($result,true);
  944 + return $data;
  945 + }
  946 +
  947 + /**
  948 + * 添加网站反代信息
  949 + * @param [type] $cache 是否缓存
  950 + * @param [type] $proxyname 代理名称
  951 + * @param [type] $cachetime 缓存时长 /小时
  952 + * @param [type] $proxydir 代理目录
  953 + * @param [type] $proxysite 反代URL
  954 + * @param [type] $todomain 目标域名
  955 + * @param [type] $advanced 高级功能:开启代理目录
  956 + * @param [type] $sitename 网站名
  957 + * @param [type] $subfilter 文本替换json格式[{"sub1":"百度","sub2":"白底"},{"sub1":"","sub2":""}]
  958 + * @param [type] $type 开启或关闭 0关;1开
  959 + */
  960 + public function CreateProxy($cache,$proxyname,$cachetime,$proxydir,$proxysite,$todomain,$advanced,$sitename,$subfilter,$type){
  961 + $url = $this->BT_PANEL.$this->config("CreateProxy");
  962 +
  963 + $p_data = $this->GetKeyData();
  964 + $p_data['cache'] = $cache;
  965 + $p_data['proxyname'] = $proxyname;
  966 + $p_data['cachetime'] = $cachetime;
  967 + $p_data['proxydir'] = $proxydir;
  968 + $p_data['proxysite'] = $proxysite;
  969 + $p_data['todomain'] = $todomain;
  970 + $p_data['advanced'] = $advanced;
  971 + $p_data['sitename'] = $sitename;
  972 + $p_data['subfilter'] = $subfilter;
  973 + $p_data['type'] = $type;
  974 + $result = $this->HttpPostCookie($url,$p_data);
  975 +
  976 + $data = json_decode($result,true);
  977 + return $data;
  978 + }
  979 +
  980 + /**
  981 + * 添加网站反代信息
  982 + * @param [type] $cache 是否缓存
  983 + * @param [type] $proxyname 代理名称
  984 + * @param [type] $cachetime 缓存时长 /小时
  985 + * @param [type] $proxydir 代理目录
  986 + * @param [type] $proxysite 反代URL
  987 + * @param [type] $todomain 目标域名
  988 + * @param [type] $advanced 高级功能:开启代理目录
  989 + * @param [type] $sitename 网站名
  990 + * @param [type] $subfilter 文本替换json格式[{"sub1":"百度","sub2":"白底"},{"sub1":"","sub2":""}]
  991 + * @param [type] $type 开启或关闭 0关;1开
  992 + */
  993 + public function ModifyProxy($cache,$proxyname,$cachetime,$proxydir,$proxysite,$todomain,$advanced,$sitename,$subfilter,$type){
  994 + $url = $this->BT_PANEL.$this->config("ModifyProxy");
  995 +
  996 + $p_data = $this->GetKeyData();
  997 + $p_data['cache'] = $cache;
  998 + $p_data['proxyname'] = $proxyname;
  999 + $p_data['cachetime'] = $cachetime;
  1000 + $p_data['proxydir'] = $proxydir;
  1001 + $p_data['proxysite'] = $proxysite;
  1002 + $p_data['todomain'] = $todomain;
  1003 + $p_data['advanced'] = $advanced;
  1004 + $p_data['sitename'] = $sitename;
  1005 + $p_data['subfilter'] = $subfilter;
  1006 + $p_data['type'] = $type;
  1007 + $result = $this->HttpPostCookie($url,$p_data);
  1008 +
  1009 + $data = json_decode($result,true);
  1010 + return $data;
  1011 + }
  1012 +
  1013 + /**
  1014 + * 获取网站域名绑定二级目录信息
  1015 + * @param [type] $id 网站ID
  1016 + */
  1017 + public function GetDirBinding($id){
  1018 + $url = $this->BT_PANEL.$this->config("GetDirBinding");
  1019 +
  1020 + $p_data = $this->GetKeyData();
  1021 + $p_data['id'] = $id;
  1022 + $result = $this->HttpPostCookie($url,$p_data);
  1023 +
  1024 + $data = json_decode($result,true);
  1025 + return $data;
  1026 + }
  1027 +
  1028 + /**
  1029 + * 设置网站域名绑定二级目录
  1030 + * @param [type] $id 网站ID
  1031 + * @param [type] $domain 域名
  1032 + * @param [type] $dirName 目录
  1033 + */
  1034 + public function AddDirBinding($id,$domain,$dirName){
  1035 + $url = $this->BT_PANEL.$this->config("AddDirBinding");
  1036 +
  1037 + $p_data = $this->GetKeyData();
  1038 + $p_data['id'] = $id;
  1039 + $p_data['domain'] = $domain;
  1040 + $p_data['dirName'] = $dirName;
  1041 + $result = $this->HttpPostCookie($url,$p_data);
  1042 +
  1043 + $data = json_decode($result,true);
  1044 + return $data;
  1045 + }
  1046 +
  1047 + /**
  1048 + * 删除网站域名绑定二级目录
  1049 + * @param [type] $dirid 子目录ID
  1050 + */
  1051 + public function DelDirBinding($dirid){
  1052 + $url = $this->BT_PANEL.$this->config("DelDirBinding");
  1053 +
  1054 + $p_data = $this->GetKeyData();
  1055 + $p_data['id'] = $dirid;
  1056 + $result = $this->HttpPostCookie($url,$p_data);
  1057 +
  1058 + $data = json_decode($result,true);
  1059 + return $data;
  1060 + }
  1061 +
  1062 + /**
  1063 + * 获取网站子目录绑定伪静态信息
  1064 + * @param [type] $dirid 子目录绑定ID
  1065 + */
  1066 + public function GetDirRewrite($dirid,$type=0){
  1067 + $url = $this->BT_PANEL.$this->config("GetDirRewrite");
  1068 +
  1069 + $p_data = $this->GetKeyData();
  1070 + $p_data['id'] = $dirid;
  1071 + if($type){
  1072 + $p_data['add'] = 1;
  1073 + }
  1074 + $result = $this->HttpPostCookie($url,$p_data);
  1075 +
  1076 + $data = json_decode($result,true);
  1077 + return $data;
  1078 + }
  1079 +
  1080 + /**
  1081 + * 修改FTP账号密码
  1082 + * @param [type] $id FTPID
  1083 + * @param [type] $ftp_username 用户名
  1084 + * @param [type] $new_password 密码
  1085 + */
  1086 + public function SetUserPassword($id,$ftp_username,$new_password){
  1087 + $url = $this->BT_PANEL.$this->config("SetUserPassword");
  1088 +
  1089 + $p_data = $this->GetKeyData();
  1090 + $p_data['id'] = $id;
  1091 + $p_data['ftp_username'] = $ftp_username;
  1092 + $p_data['new_password'] = $new_password;
  1093 + $result = $this->HttpPostCookie($url,$p_data);
  1094 +
  1095 + $data = json_decode($result,true);
  1096 + return $data;
  1097 + }
  1098 +
  1099 + /**
  1100 + * 修改SQL账号密码
  1101 + * @param [type] $id SQLID
  1102 + * @param [type] $ftp_username 用户名
  1103 + * @param [type] $new_password 密码
  1104 + */
  1105 + public function ResDatabasePass($id,$name,$password){
  1106 + $url = $this->BT_PANEL.$this->config("ResDatabasePass");
  1107 +
  1108 + $p_data = $this->GetKeyData();
  1109 + $p_data['id'] = $id;
  1110 + $p_data['name'] = $name;
  1111 + $p_data['password'] = $password;
  1112 + $result = $this->HttpPostCookie($url,$p_data);
  1113 +
  1114 + $data = json_decode($result,true);
  1115 + return $data;
  1116 + }
  1117 +
  1118 + /**
  1119 + * 启用/禁用FTP
  1120 + * @param [type] $id FTPID
  1121 + * @param [type] $username 用户名
  1122 + * @param [type] $status 状态 0->关闭;1->开启
  1123 + */
  1124 + public function SetStatus($id,$username,$status){
  1125 + $url = $this->BT_PANEL.$this->config("SetStatus");
  1126 +
  1127 + $p_data = $this->GetKeyData();
  1128 + $p_data['id'] = $id;
  1129 + $p_data['username'] = $username;
  1130 + $p_data['status'] = $status;
  1131 + $result = $this->HttpPostCookie($url,$p_data);
  1132 +
  1133 + $data = json_decode($result,true);
  1134 + return $data;
  1135 + }
  1136 +
  1137 + /**
  1138 + * 宝塔一键部署列表
  1139 + * @param string $search 搜索关键词
  1140 + * @return [type] [description]
  1141 + */
  1142 + public function deployment($search=''){
  1143 + if($search){
  1144 + $url = $this->BT_PANEL.$this->config("deployment").'&search='.$search;
  1145 + }else{
  1146 + $url = $this->BT_PANEL.$this->config("deployment");
  1147 + }
  1148 +
  1149 + $p_data = $this->GetKeyData();
  1150 + $result = $this->HttpPostCookie($url,$p_data);
  1151 +
  1152 + $data = json_decode($result,true);
  1153 + return $data;
  1154 + }
  1155 +
  1156 + /**
  1157 + * 宝塔一键部署执行
  1158 + * @param [type] $dname 部署程序名
  1159 + * @param [type] $site_name 部署到网站名
  1160 + * @param [type] $php_version PHP版本
  1161 + */
  1162 + public function SetupPackage($dname,$site_name,$php_version){
  1163 + $url = $this->BT_PANEL.$this->config("SetupPackage");
  1164 +
  1165 + $p_data = $this->GetKeyData();
  1166 + $p_data['dname'] = $dname;
  1167 + $p_data['site_name'] = $site_name;
  1168 + $p_data['php_version'] = $php_version;
  1169 + $result = $this->HttpPostCookie($url,$p_data);
  1170 +
  1171 + $data = json_decode($result,true);
  1172 + return $data;
  1173 + }
  1174 +
  1175 +
  1176 + /**
  1177 + * 构造带有签名的关联数组
  1178 + */
  1179 + public function GetKeyData(){
  1180 + $now_time = time();
  1181 + $p_data = array(
  1182 + 'request_token' => md5($now_time.''.md5($this->BT_KEY)),
  1183 + 'request_time' => $now_time
  1184 + );
  1185 + return $p_data;
  1186 + }
  1187 +
  1188 + /**
  1189 + * 发起POST请求
  1190 + * @param String $url 目标网填,带http://
  1191 + * @param Array|String $data 欲提交的数据
  1192 + * @return string
  1193 + */
  1194 + private function HttpPostCookie($url, $data,$timeout = 60)
  1195 + {
  1196 + //定义cookie保存位置
  1197 + $cookie_file='./'.md5($this->BT_PANEL).'.cookie';
  1198 + if(!file_exists($cookie_file)){
  1199 + $fp = fopen($cookie_file,'w+');
  1200 + fclose($fp);
  1201 + }
  1202 +
  1203 + $ch = curl_init();
  1204 + curl_setopt($ch, CURLOPT_URL, $url);
  1205 + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  1206 + curl_setopt($ch, CURLOPT_POST, 1);
  1207 + curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  1208 + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
  1209 + curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
  1210 + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1211 + curl_setopt($ch, CURLOPT_HEADER, 0);
  1212 + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  1213 + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  1214 + $output = curl_exec($ch);
  1215 + curl_close($ch);
  1216 + return $output;
  1217 + }
  1218 +
  1219 + /**
  1220 + * 加载宝塔数据接口
  1221 + * @param [type] $str [description]
  1222 + * @return [type] [description]
  1223 + */
  1224 + private function config($str){
  1225 + $config = config("bt");
  1226 + //var_dump($config);
  1227 + return $config[$str];
  1228 + }
  1229 +}
  1230 +
  1231 +
  1232 +
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: zhl
  5 + * Date: 2022/11/1
  6 + * Time: 11:56
  7 + */
  8 +
  9 +namespace App\Repositories;
  10 +
  11 +use App\Models\BtSites;
  12 +use App\Repositories\Bt\Bt;
  13 +
  14 +/**
  15 + * Class BtRepositories
  16 + * @package App\Repositories
  17 + */
  18 +class BtRepositories
  19 +{
  20 + public $instance = [];
  21 +
  22 + /**
  23 + * @param $domain
  24 + * @param $ssl_open
  25 + * @param $ssl_auto
  26 + * @param $ssl_auto_day
  27 + * @return array|bool
  28 + */
  29 + public function createBtSite($domain, $ssl_open, $ssl_auto, $ssl_auto_day)
  30 + {
  31 + $domain_array = parse_url($domain);
  32 + $host = $domain_array['host'];
  33 +
  34 + $host_array = explode('.', $host);
  35 + if (empty($host_array[0]) && $host_array[0] == 'www')
  36 + unset($host_array[0]);
  37 + $domain_top = implode('.', $host_array);
  38 +
  39 + $web_name = ['domain' => $host, 'domainlist' => [$domain_top], 'count' => 0];
  40 + $array = [
  41 + 'webname' => json_encode($web_name),
  42 + 'path' => env('PROJECT_PATH') ? env('PROJECT_PATH') : dirname(dirname(app_path())) . DIRECTORY_SEPARATOR . $domain,
  43 + 'type_id' => 0,
  44 + 'type' => 'PHP',
  45 + 'version' => '73',
  46 + 'port' => '80',
  47 + 'ps' => $host,
  48 + 'ftp' => false,
  49 + 'ftp_username' => '',
  50 + 'ftp_password' => '',
  51 + 'sql' => false,
  52 + 'codeing' => '',
  53 + 'datauser' => '',
  54 + 'datapassword' => '',
  55 + ];
  56 +
  57 + $bt = $this->getBtObject();
  58 + $result = $bt->AddSite($array);
  59 +
  60 + if (empty($result) || empty($result['id']))
  61 + return false;
  62 +
  63 + $ssl_status = 0;
  64 + $result = BtSites::createBtSite($host, $result['id'], $ssl_open, $ssl_status, $ssl_auto, $ssl_auto_day);
  65 + return $result->toArray();
  66 + }
  67 +
  68 + /**
  69 + * 删除站点
  70 + * @param $domain
  71 + * @return bool
  72 + */
  73 + public function deleteBtSite($domain)
  74 + {
  75 + $domain = parse_url($domain);
  76 + $domain_array = parse_url($domain);
  77 + $host = $domain_array['host'];
  78 +
  79 + $bt = $this->getBtObject();
  80 +
  81 + $site = BtSites::getSiteByDomain($host);
  82 +// $id = $site->site_id;
  83 + // 获取bt数据 可能要可靠一些
  84 + $result = $bt->Websites($host);
  85 + if (empty($result['data']))
  86 + return false;
  87 + $id = 0;
  88 + foreach ($result['data'] as $v) {
  89 + if ($v['name'] == $domain) {
  90 + $id = $v['id'];
  91 + break;
  92 + }
  93 + }
  94 +
  95 + if (empty($id))
  96 + return false;
  97 + $result = $bt->WebDeleteSite($id,$domain,false,false,false);
  98 +
  99 + $site->is_del = BtSites::IS_DEL_TRUE;
  100 + $site->save();
  101 + return true;
  102 + }
  103 +
  104 + /**
  105 + * 获取bt对象
  106 + * @param string $key
  107 + * @param string $panel
  108 + * @return Bt
  109 + */
  110 + public function getBtObject($key = '', $panel = '')
  111 + {
  112 + $key = $key ?: env('BT_KEY');
  113 + $panel = $panel ?: env('BT_PANEL');
  114 + $object_key = md5($key . $panel);
  115 + if (empty($this->instance[$object_key])) {
  116 + $bt = new Bt($panel, $key);
  117 + $this->instance[$object_key] = $bt;
  118 + }
  119 + return $this->instance[$object_key];
  120 + }
  121 +}
  1 +#!/usr/bin/env php
  2 +<?php
  3 +
  4 +define('LARAVEL_START', microtime(true));
  5 +
  6 +/*
  7 +|--------------------------------------------------------------------------
  8 +| Register The Auto Loader
  9 +|--------------------------------------------------------------------------
  10 +|
  11 +| Composer provides a convenient, automatically generated class loader
  12 +| for our application. We just need to utilize it! We'll require it
  13 +| into the script here so that we do not have to worry about the
  14 +| loading of any of our classes manually. It's great to relax.
  15 +|
  16 +*/
  17 +
  18 +require __DIR__.'/vendor/autoload.php';
  19 +
  20 +$app = require_once __DIR__.'/bootstrap/app.php';
  21 +
  22 +/*
  23 +|--------------------------------------------------------------------------
  24 +| Run The Artisan Application
  25 +|--------------------------------------------------------------------------
  26 +|
  27 +| When we run the console application, the current CLI command will be
  28 +| executed in this console and the response sent back to a terminal
  29 +| or another output device for the developers. Here goes nothing!
  30 +|
  31 +*/
  32 +
  33 +$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
  34 +
  35 +$status = $kernel->handle(
  36 + $input = new Symfony\Component\Console\Input\ArgvInput,
  37 + new Symfony\Component\Console\Output\ConsoleOutput
  38 +);
  39 +
  40 +/*
  41 +|--------------------------------------------------------------------------
  42 +| Shutdown The Application
  43 +|--------------------------------------------------------------------------
  44 +|
  45 +| Once Artisan has finished running, we will fire off the shutdown events
  46 +| so that any final work may be done by the application before we shut
  47 +| down the process. This is the last thing to happen to the request.
  48 +|
  49 +*/
  50 +
  51 +$kernel->terminate($input, $status);
  52 +
  53 +exit($status);
  1 +<?php
  2 +
  3 +/*
  4 +|--------------------------------------------------------------------------
  5 +| Create The Application
  6 +|--------------------------------------------------------------------------
  7 +|
  8 +| The first thing we will do is create a new Laravel application instance
  9 +| which serves as the "glue" for all the components of Laravel, and is
  10 +| the IoC container for the system binding all of the various parts.
  11 +|
  12 +*/
  13 +
  14 +$app = new Illuminate\Foundation\Application(
  15 + $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
  16 +);
  17 +
  18 +/*
  19 +|--------------------------------------------------------------------------
  20 +| Bind Important Interfaces
  21 +|--------------------------------------------------------------------------
  22 +|
  23 +| Next, we need to bind some important interfaces into the container so
  24 +| we will be able to resolve them when needed. The kernels serve the
  25 +| incoming requests to this application from both the web and CLI.
  26 +|
  27 +*/
  28 +
  29 +$app->singleton(
  30 + Illuminate\Contracts\Http\Kernel::class,
  31 + App\Http\Kernel::class
  32 +);
  33 +
  34 +$app->singleton(
  35 + Illuminate\Contracts\Console\Kernel::class,
  36 + App\Console\Kernel::class
  37 +);
  38 +
  39 +$app->singleton(
  40 + Illuminate\Contracts\Debug\ExceptionHandler::class,
  41 + App\Exceptions\Handler::class
  42 +);
  43 +
  44 +/*
  45 +|--------------------------------------------------------------------------
  46 +| Return The Application
  47 +|--------------------------------------------------------------------------
  48 +|
  49 +| This script returns the application instance. The instance is given to
  50 +| the calling script so we can separate the building of the instances
  51 +| from the actual running of the application and sending responses.
  52 +|
  53 +*/
  54 +
  55 +return $app;
  1 +*
  2 +!.gitignore
  1 +{
  2 + "name": "laravel/laravel",
  3 + "type": "project",
  4 + "description": "The Laravel Framework.",
  5 + "keywords": ["framework", "laravel"],
  6 + "license": "MIT",
  7 + "require": {
  8 + "php": "^7.3|^8.0",
  9 + "fruitcake/laravel-cors": "^2.0",
  10 + "guzzlehttp/guzzle": "^7.0.1",
  11 + "laravel/framework": "^8.75",
  12 + "laravel/sanctum": "^2.11",
  13 + "laravel/tinker": "^2.5"
  14 + },
  15 + "require-dev": {
  16 + "facade/ignition": "^2.5",
  17 + "fakerphp/faker": "^1.9.1",
  18 + "laravel/sail": "^1.0.1",
  19 + "mockery/mockery": "^1.4.4",
  20 + "nunomaduro/collision": "^5.10",
  21 + "phpunit/phpunit": "^9.5.10"
  22 + },
  23 + "autoload": {
  24 + "psr-4": {
  25 + "App\\": "app/",
  26 + "Database\\Factories\\": "database/factories/",
  27 + "Database\\Seeders\\": "database/seeders/"
  28 + }
  29 + },
  30 + "autoload-dev": {
  31 + "psr-4": {
  32 + "Tests\\": "tests/"
  33 + }
  34 + },
  35 + "scripts": {
  36 + "post-autoload-dump": [
  37 + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
  38 + "@php artisan package:discover --ansi"
  39 + ],
  40 + "post-update-cmd": [
  41 + "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
  42 + ],
  43 + "post-root-package-install": [
  44 + "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
  45 + ],
  46 + "post-create-project-cmd": [
  47 + "@php artisan key:generate --ansi"
  48 + ]
  49 + },
  50 + "extra": {
  51 + "laravel": {
  52 + "dont-discover": []
  53 + }
  54 + },
  55 + "config": {
  56 + "optimize-autoloader": true,
  57 + "preferred-install": "dist",
  58 + "sort-packages": true
  59 + },
  60 + "minimum-stability": "dev",
  61 + "prefer-stable": true
  62 +}
此 diff 太大无法显示。
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Application Name
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This value is the name of your application. This value is used when the
  11 + | framework needs to place the application's name in a notification or
  12 + | any other location as required by the application or its packages.
  13 + |
  14 + */
  15 +
  16 + 'name' => env('APP_NAME', 'Laravel'),
  17 +
  18 + /*
  19 + |--------------------------------------------------------------------------
  20 + | Application Environment
  21 + |--------------------------------------------------------------------------
  22 + |
  23 + | This value determines the "environment" your application is currently
  24 + | running in. This may determine how you prefer to configure various
  25 + | services the application utilizes. Set this in your ".env" file.
  26 + |
  27 + */
  28 +
  29 + 'env' => env('APP_ENV', 'production'),
  30 +
  31 + /*
  32 + |--------------------------------------------------------------------------
  33 + | Application Debug Mode
  34 + |--------------------------------------------------------------------------
  35 + |
  36 + | When your application is in debug mode, detailed error messages with
  37 + | stack traces will be shown on every error that occurs within your
  38 + | application. If disabled, a simple generic error page is shown.
  39 + |
  40 + */
  41 +
  42 + 'debug' => (bool) env('APP_DEBUG', false),
  43 +
  44 + /*
  45 + |--------------------------------------------------------------------------
  46 + | Application URL
  47 + |--------------------------------------------------------------------------
  48 + |
  49 + | This URL is used by the console to properly generate URLs when using
  50 + | the Artisan command line tool. You should set this to the root of
  51 + | your application so that it is used when running Artisan tasks.
  52 + |
  53 + */
  54 +
  55 + 'url' => env('APP_URL', 'http://localhost'),
  56 +
  57 + 'asset_url' => env('ASSET_URL', null),
  58 +
  59 + /*
  60 + |--------------------------------------------------------------------------
  61 + | Application Timezone
  62 + |--------------------------------------------------------------------------
  63 + |
  64 + | Here you may specify the default timezone for your application, which
  65 + | will be used by the PHP date and date-time functions. We have gone
  66 + | ahead and set this to a sensible default for you out of the box.
  67 + |
  68 + */
  69 +
  70 + 'timezone' => 'UTC',
  71 +
  72 + /*
  73 + |--------------------------------------------------------------------------
  74 + | Application Locale Configuration
  75 + |--------------------------------------------------------------------------
  76 + |
  77 + | The application locale determines the default locale that will be used
  78 + | by the translation service provider. You are free to set this value
  79 + | to any of the locales which will be supported by the application.
  80 + |
  81 + */
  82 +
  83 + 'locale' => 'en',
  84 +
  85 + /*
  86 + |--------------------------------------------------------------------------
  87 + | Application Fallback Locale
  88 + |--------------------------------------------------------------------------
  89 + |
  90 + | The fallback locale determines the locale to use when the current one
  91 + | is not available. You may change the value to correspond to any of
  92 + | the language folders that are provided through your application.
  93 + |
  94 + */
  95 +
  96 + 'fallback_locale' => 'en',
  97 +
  98 + /*
  99 + |--------------------------------------------------------------------------
  100 + | Faker Locale
  101 + |--------------------------------------------------------------------------
  102 + |
  103 + | This locale will be used by the Faker PHP library when generating fake
  104 + | data for your database seeds. For example, this will be used to get
  105 + | localized telephone numbers, street address information and more.
  106 + |
  107 + */
  108 +
  109 + 'faker_locale' => 'en_US',
  110 +
  111 + /*
  112 + |--------------------------------------------------------------------------
  113 + | Encryption Key
  114 + |--------------------------------------------------------------------------
  115 + |
  116 + | This key is used by the Illuminate encrypter service and should be set
  117 + | to a random, 32 character string, otherwise these encrypted strings
  118 + | will not be safe. Please do this before deploying an application!
  119 + |
  120 + */
  121 +
  122 + 'key' => env('APP_KEY'),
  123 +
  124 + 'cipher' => 'AES-256-CBC',
  125 +
  126 + /*
  127 + |--------------------------------------------------------------------------
  128 + | Autoloaded Service Providers
  129 + |--------------------------------------------------------------------------
  130 + |
  131 + | The service providers listed here will be automatically loaded on the
  132 + | request to your application. Feel free to add your own services to
  133 + | this array to grant expanded functionality to your applications.
  134 + |
  135 + */
  136 +
  137 + 'providers' => [
  138 +
  139 + /*
  140 + * Laravel Framework Service Providers...
  141 + */
  142 + Illuminate\Auth\AuthServiceProvider::class,
  143 + Illuminate\Broadcasting\BroadcastServiceProvider::class,
  144 + Illuminate\Bus\BusServiceProvider::class,
  145 + Illuminate\Cache\CacheServiceProvider::class,
  146 + Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
  147 + Illuminate\Cookie\CookieServiceProvider::class,
  148 + Illuminate\Database\DatabaseServiceProvider::class,
  149 + Illuminate\Encryption\EncryptionServiceProvider::class,
  150 + Illuminate\Filesystem\FilesystemServiceProvider::class,
  151 + Illuminate\Foundation\Providers\FoundationServiceProvider::class,
  152 + Illuminate\Hashing\HashServiceProvider::class,
  153 + Illuminate\Mail\MailServiceProvider::class,
  154 + Illuminate\Notifications\NotificationServiceProvider::class,
  155 + Illuminate\Pagination\PaginationServiceProvider::class,
  156 + Illuminate\Pipeline\PipelineServiceProvider::class,
  157 + Illuminate\Queue\QueueServiceProvider::class,
  158 + Illuminate\Redis\RedisServiceProvider::class,
  159 + Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
  160 + Illuminate\Session\SessionServiceProvider::class,
  161 + Illuminate\Translation\TranslationServiceProvider::class,
  162 + Illuminate\Validation\ValidationServiceProvider::class,
  163 + Illuminate\View\ViewServiceProvider::class,
  164 +
  165 + /*
  166 + * Package Service Providers...
  167 + */
  168 +
  169 + /*
  170 + * Application Service Providers...
  171 + */
  172 + App\Providers\AppServiceProvider::class,
  173 + App\Providers\AuthServiceProvider::class,
  174 + // App\Providers\BroadcastServiceProvider::class,
  175 + App\Providers\EventServiceProvider::class,
  176 + App\Providers\RouteServiceProvider::class,
  177 +
  178 + ],
  179 +
  180 + /*
  181 + |--------------------------------------------------------------------------
  182 + | Class Aliases
  183 + |--------------------------------------------------------------------------
  184 + |
  185 + | This array of class aliases will be registered when this application
  186 + | is started. However, feel free to register as many as you wish as
  187 + | the aliases are "lazy" loaded so they don't hinder performance.
  188 + |
  189 + */
  190 +
  191 + 'aliases' => [
  192 +
  193 + 'App' => Illuminate\Support\Facades\App::class,
  194 + 'Arr' => Illuminate\Support\Arr::class,
  195 + 'Artisan' => Illuminate\Support\Facades\Artisan::class,
  196 + 'Auth' => Illuminate\Support\Facades\Auth::class,
  197 + 'Blade' => Illuminate\Support\Facades\Blade::class,
  198 + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
  199 + 'Bus' => Illuminate\Support\Facades\Bus::class,
  200 + 'Cache' => Illuminate\Support\Facades\Cache::class,
  201 + 'Config' => Illuminate\Support\Facades\Config::class,
  202 + 'Cookie' => Illuminate\Support\Facades\Cookie::class,
  203 + 'Crypt' => Illuminate\Support\Facades\Crypt::class,
  204 + 'Date' => Illuminate\Support\Facades\Date::class,
  205 + 'DB' => Illuminate\Support\Facades\DB::class,
  206 + 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
  207 + 'Event' => Illuminate\Support\Facades\Event::class,
  208 + 'File' => Illuminate\Support\Facades\File::class,
  209 + 'Gate' => Illuminate\Support\Facades\Gate::class,
  210 + 'Hash' => Illuminate\Support\Facades\Hash::class,
  211 + 'Http' => Illuminate\Support\Facades\Http::class,
  212 + 'Js' => Illuminate\Support\Js::class,
  213 + 'Lang' => Illuminate\Support\Facades\Lang::class,
  214 + 'Log' => Illuminate\Support\Facades\Log::class,
  215 + 'Mail' => Illuminate\Support\Facades\Mail::class,
  216 + 'Notification' => Illuminate\Support\Facades\Notification::class,
  217 + 'Password' => Illuminate\Support\Facades\Password::class,
  218 + 'Queue' => Illuminate\Support\Facades\Queue::class,
  219 + 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
  220 + 'Redirect' => Illuminate\Support\Facades\Redirect::class,
  221 + // 'Redis' => Illuminate\Support\Facades\Redis::class,
  222 + 'Request' => Illuminate\Support\Facades\Request::class,
  223 + 'Response' => Illuminate\Support\Facades\Response::class,
  224 + 'Route' => Illuminate\Support\Facades\Route::class,
  225 + 'Schema' => Illuminate\Support\Facades\Schema::class,
  226 + 'Session' => Illuminate\Support\Facades\Session::class,
  227 + 'Storage' => Illuminate\Support\Facades\Storage::class,
  228 + 'Str' => Illuminate\Support\Str::class,
  229 + 'URL' => Illuminate\Support\Facades\URL::class,
  230 + 'Validator' => Illuminate\Support\Facades\Validator::class,
  231 + 'View' => Illuminate\Support\Facades\View::class,
  232 +
  233 + ],
  234 +
  235 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Authentication Defaults
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This option controls the default authentication "guard" and password
  11 + | reset options for your application. You may change these defaults
  12 + | as required, but they're a perfect start for most applications.
  13 + |
  14 + */
  15 +
  16 + 'defaults' => [
  17 + 'guard' => 'web',
  18 + 'passwords' => 'users',
  19 + ],
  20 +
  21 + /*
  22 + |--------------------------------------------------------------------------
  23 + | Authentication Guards
  24 + |--------------------------------------------------------------------------
  25 + |
  26 + | Next, you may define every authentication guard for your application.
  27 + | Of course, a great default configuration has been defined for you
  28 + | here which uses session storage and the Eloquent user provider.
  29 + |
  30 + | All authentication drivers have a user provider. This defines how the
  31 + | users are actually retrieved out of your database or other storage
  32 + | mechanisms used by this application to persist your user's data.
  33 + |
  34 + | Supported: "session"
  35 + |
  36 + */
  37 +
  38 + 'guards' => [
  39 + 'web' => [
  40 + 'driver' => 'session',
  41 + 'provider' => 'users',
  42 + ],
  43 + ],
  44 +
  45 + /*
  46 + |--------------------------------------------------------------------------
  47 + | User Providers
  48 + |--------------------------------------------------------------------------
  49 + |
  50 + | All authentication drivers have a user provider. This defines how the
  51 + | users are actually retrieved out of your database or other storage
  52 + | mechanisms used by this application to persist your user's data.
  53 + |
  54 + | If you have multiple user tables or models you may configure multiple
  55 + | sources which represent each model / table. These sources may then
  56 + | be assigned to any extra authentication guards you have defined.
  57 + |
  58 + | Supported: "database", "eloquent"
  59 + |
  60 + */
  61 +
  62 + 'providers' => [
  63 + 'users' => [
  64 + 'driver' => 'eloquent',
  65 + 'model' => App\Models\User::class,
  66 + ],
  67 +
  68 + // 'users' => [
  69 + // 'driver' => 'database',
  70 + // 'table' => 'users',
  71 + // ],
  72 + ],
  73 +
  74 + /*
  75 + |--------------------------------------------------------------------------
  76 + | Resetting Passwords
  77 + |--------------------------------------------------------------------------
  78 + |
  79 + | You may specify multiple password reset configurations if you have more
  80 + | than one user table or model in the application and you want to have
  81 + | separate password reset settings based on the specific user types.
  82 + |
  83 + | The expire time is the number of minutes that each reset token will be
  84 + | considered valid. This security feature keeps tokens short-lived so
  85 + | they have less time to be guessed. You may change this as needed.
  86 + |
  87 + */
  88 +
  89 + 'passwords' => [
  90 + 'users' => [
  91 + 'provider' => 'users',
  92 + 'table' => 'password_resets',
  93 + 'expire' => 60,
  94 + 'throttle' => 60,
  95 + ],
  96 + ],
  97 +
  98 + /*
  99 + |--------------------------------------------------------------------------
  100 + | Password Confirmation Timeout
  101 + |--------------------------------------------------------------------------
  102 + |
  103 + | Here you may define the amount of seconds before a password confirmation
  104 + | times out and the user is prompted to re-enter their password via the
  105 + | confirmation screen. By default, the timeout lasts for three hours.
  106 + |
  107 + */
  108 +
  109 + 'password_timeout' => 10800,
  110 +
  111 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Default Broadcaster
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This option controls the default broadcaster that will be used by the
  11 + | framework when an event needs to be broadcast. You may set this to
  12 + | any of the connections defined in the "connections" array below.
  13 + |
  14 + | Supported: "pusher", "ably", "redis", "log", "null"
  15 + |
  16 + */
  17 +
  18 + 'default' => env('BROADCAST_DRIVER', 'null'),
  19 +
  20 + /*
  21 + |--------------------------------------------------------------------------
  22 + | Broadcast Connections
  23 + |--------------------------------------------------------------------------
  24 + |
  25 + | Here you may define all of the broadcast connections that will be used
  26 + | to broadcast events to other systems or over websockets. Samples of
  27 + | each available type of connection are provided inside this array.
  28 + |
  29 + */
  30 +
  31 + 'connections' => [
  32 +
  33 + 'pusher' => [
  34 + 'driver' => 'pusher',
  35 + 'key' => env('PUSHER_APP_KEY'),
  36 + 'secret' => env('PUSHER_APP_SECRET'),
  37 + 'app_id' => env('PUSHER_APP_ID'),
  38 + 'options' => [
  39 + 'cluster' => env('PUSHER_APP_CLUSTER'),
  40 + 'useTLS' => true,
  41 + ],
  42 + ],
  43 +
  44 + 'ably' => [
  45 + 'driver' => 'ably',
  46 + 'key' => env('ABLY_KEY'),
  47 + ],
  48 +
  49 + 'redis' => [
  50 + 'driver' => 'redis',
  51 + 'connection' => 'default',
  52 + ],
  53 +
  54 + 'log' => [
  55 + 'driver' => 'log',
  56 + ],
  57 +
  58 + 'null' => [
  59 + 'driver' => 'null',
  60 + ],
  61 +
  62 + ],
  63 +
  64 +];
  1 +<?php
  2 +// +----------------------------------------------------------------------
  3 +// | 宝塔接口配置文件
  4 +// +----------------------------------------------------------------------
  5 +return array(
  6 + # 系统状态相关接口
  7 + 'GetSystemTotal' => '/system?action=GetSystemTotal', //获取系统基础统计
  8 + 'GetDiskInfo' => '/system?action=GetDiskInfo', //获取磁盘分区信息
  9 + 'GetNetWork' => '/system?action=GetNetWork', //获取实时状态信息(CPU、内存、网络、负载)
  10 + 'GetTaskCount' => '/ajax?action=GetTaskCount', //检查是否有安装任务
  11 + 'UpdatePanel' => '/ajax?action=UpdatePanel', //检查面板更新
  12 + # 网站管理相关接口
  13 + 'Websites' => '/data?action=getData&table=sites', //获取网站列表
  14 + 'Webtypes' => '/site?action=get_site_types', //获取网站分类
  15 + 'GetPHPVersion' => '/site?action=GetPHPVersion', //获取已安装的 PHP 版本列表
  16 + 'GetSitePHPVersion' => '/site?action=GetSitePHPVersion', //获取指定网站运行的PHP版本
  17 + 'SetPHPVersion' => '/site?action=SetPHPVersion', //修改指定网站的PHP版本
  18 + 'SetHasPwd' => '/site?action=SetHasPwd', //开启并设置网站密码访问
  19 + 'CloseHasPwd' => '/site?action=CloseHasPwd', //关闭网站密码访问
  20 + 'GetDirUserINI' => '/site?action=GetDirUserINI', //获取网站几项开关(防跨站、日志、密码访问)
  21 + 'WebAddSite' => '/site?action=AddSite', //创建网站
  22 + 'WebDeleteSite' => '/site?action=DeleteSite', //删除网站
  23 + 'WebSiteStop' => '/site?action=SiteStop', //停用网站
  24 + 'WebSiteStart' => '/site?action=SiteStart', //启用网站
  25 + 'WebSetEdate' => '/site?action=SetEdate', //设置网站有效期
  26 + 'WebSetPs' => '/data?action=setPs&table=sites', //修改网站备注
  27 + 'WebBackupList' => '/data?action=getData&table=backup', //获取网站备份列表
  28 + 'WebToBackup' => '/site?action=ToBackup', //创建网站备份
  29 + 'WebDelBackup' => '/site?action=DelBackup', //删除网站备份
  30 + 'WebDoaminList' => '/data?action=getData&table=domain', //获取网站域名列表
  31 + 'GetDirBinding' => '/site?action=GetDirBinding', //获取网站域名绑定二级目录信息
  32 + 'AddDirBinding' => '/site?action=AddDirBinding', //添加网站子目录域名
  33 + 'DelDirBinding' => '/site?action=DelDirBinding', //删除网站绑定子目录
  34 + 'GetDirRewrite' => '/site?action=GetDirRewrite', //获取网站子目录伪静态规则
  35 + 'WebAddDomain' => '/site?action=AddDomain', //添加网站域名
  36 + 'WebDelDomain' => '/site?action=DelDomain', //删除网站域名
  37 + 'GetSiteLogs' => '/site?action=GetSiteLogs', //获取网站日志
  38 + 'GetSecurity' => '/site?action=GetSecurity', //获取网站盗链状态及规则信息
  39 + 'SetSecurity' => '/site?action=SetSecurity', //设置网站盗链状态及规则信息
  40 + 'GetSSL' => '/site?action=GetSSL', //获取SSL状态及证书详情
  41 + 'HttpToHttps' => '/site?action=HttpToHttps', //强制HTTPS
  42 + 'CloseToHttps' => '/site?action=CloseToHttps', //关闭强制HTTPS
  43 + 'SetSSL' => '/site?action=SetSSL', //设置SSL证书
  44 + "ApplyCert" => '/acme?action=apply_cert_api', //申请证书
  45 + "RenewCert" => '/acme?action=renew_cert',
  46 + 'CloseSSLConf' => '/site?action=CloseSSLConf', //关闭SSL
  47 + 'WebGetIndex' => '/site?action=GetIndex', //获取网站默认文件
  48 + 'WebSetIndex' => '/site?action=SetIndex', //设置网站默认文件
  49 + 'GetLimitNet' => '/site?action=GetLimitNet', //获取网站流量限制信息
  50 + 'SetLimitNet' => '/site?action=SetLimitNet', //设置网站流量限制信息
  51 + 'CloseLimitNet' => '/site?action=CloseLimitNet', //关闭网站流量限制
  52 + 'Get301Status' => '/site?action=Get301Status', //获取网站301重定向信息
  53 + 'Set301Status' => '/site?action=Set301Status', //设置网站301重定向信息
  54 + 'GetRewriteList' => '/site?action=GetRewriteList', //获取可选的预定义伪静态列表
  55 + 'GetFileBody' => '/files?action=GetFileBody', //获取指定预定义伪静态规则内容(获取文件内容)
  56 + 'SaveFileBody' => '/files?action=SaveFileBody', //保存伪静态规则内容(保存文件内容)
  57 + 'GetProxyList' => '/site?action=GetProxyList', //获取网站反代信息及状态
  58 + 'CreateProxy' => '/site?action=CreateProxy', //添加网站反代信息
  59 + 'ModifyProxy' => '/site?action=ModifyProxy', //修改网站反代信息
  60 +
  61 + # Ftp管理
  62 + 'WebFtpList' => '/data?action=getData&table=ftps', //获取FTP信息列表
  63 + 'SetUserPassword' => '/ftp?action=SetUserPassword', //修改FTP账号密码
  64 + 'SetStatus' => '/ftp?action=SetStatus', //启用/禁用FTP
  65 +
  66 + # Sql管理
  67 + 'WebSqlList' => '/data?action=getData&table=databases', //获取SQL信息列表
  68 + 'ResDatabasePass' => '/database?action=ResDatabasePassword', //修改SQL账号密码
  69 + 'SQLToBackup' => '/database?action=ToBackup', //创建sql备份
  70 + 'SQLDelBackup' => '/database?action=DelBackup', //删除sql备份
  71 +
  72 + 'download' => '/download?filename=', //下载备份文件(目前暂停使用)
  73 +
  74 + # 插件管理
  75 + 'deployment' => '/plugin?action=a&name=deployment&s=GetList&type=0', //宝塔一键部署列表
  76 + 'SetupPackage' => '/plugin?action=a&name=deployment&s=SetupPackage', //部署任务
  77 +
  78 +
  79 +);
  1 +<?php
  2 +
  3 +use Illuminate\Support\Str;
  4 +
  5 +return [
  6 +
  7 + /*
  8 + |--------------------------------------------------------------------------
  9 + | Default Cache Store
  10 + |--------------------------------------------------------------------------
  11 + |
  12 + | This option controls the default cache connection that gets used while
  13 + | using this caching library. This connection is used when another is
  14 + | not explicitly specified when executing a given caching function.
  15 + |
  16 + */
  17 +
  18 + 'default' => env('CACHE_DRIVER', 'file'),
  19 +
  20 + /*
  21 + |--------------------------------------------------------------------------
  22 + | Cache Stores
  23 + |--------------------------------------------------------------------------
  24 + |
  25 + | Here you may define all of the cache "stores" for your application as
  26 + | well as their drivers. You may even define multiple stores for the
  27 + | same cache driver to group types of items stored in your caches.
  28 + |
  29 + | Supported drivers: "apc", "array", "database", "file",
  30 + | "memcached", "redis", "dynamodb", "octane", "null"
  31 + |
  32 + */
  33 +
  34 + 'stores' => [
  35 +
  36 + 'apc' => [
  37 + 'driver' => 'apc',
  38 + ],
  39 +
  40 + 'array' => [
  41 + 'driver' => 'array',
  42 + 'serialize' => false,
  43 + ],
  44 +
  45 + 'database' => [
  46 + 'driver' => 'database',
  47 + 'table' => 'cache',
  48 + 'connection' => null,
  49 + 'lock_connection' => null,
  50 + ],
  51 +
  52 + 'file' => [
  53 + 'driver' => 'file',
  54 + 'path' => storage_path('framework/cache/data'),
  55 + ],
  56 +
  57 + 'memcached' => [
  58 + 'driver' => 'memcached',
  59 + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
  60 + 'sasl' => [
  61 + env('MEMCACHED_USERNAME'),
  62 + env('MEMCACHED_PASSWORD'),
  63 + ],
  64 + 'options' => [
  65 + // Memcached::OPT_CONNECT_TIMEOUT => 2000,
  66 + ],
  67 + 'servers' => [
  68 + [
  69 + 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
  70 + 'port' => env('MEMCACHED_PORT', 11211),
  71 + 'weight' => 100,
  72 + ],
  73 + ],
  74 + ],
  75 +
  76 + 'redis' => [
  77 + 'driver' => 'redis',
  78 + 'connection' => 'cache',
  79 + 'lock_connection' => 'default',
  80 + ],
  81 +
  82 + 'dynamodb' => [
  83 + 'driver' => 'dynamodb',
  84 + 'key' => env('AWS_ACCESS_KEY_ID'),
  85 + 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  86 + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  87 + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
  88 + 'endpoint' => env('DYNAMODB_ENDPOINT'),
  89 + ],
  90 +
  91 + 'octane' => [
  92 + 'driver' => 'octane',
  93 + ],
  94 +
  95 + ],
  96 +
  97 + /*
  98 + |--------------------------------------------------------------------------
  99 + | Cache Key Prefix
  100 + |--------------------------------------------------------------------------
  101 + |
  102 + | When utilizing a RAM based store such as APC or Memcached, there might
  103 + | be other applications utilizing the same cache. So, we'll specify a
  104 + | value to get prefixed to all our keys so we can avoid collisions.
  105 + |
  106 + */
  107 +
  108 + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
  109 +
  110 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Cross-Origin Resource Sharing (CORS) Configuration
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | Here you may configure your settings for cross-origin resource sharing
  11 + | or "CORS". This determines what cross-origin operations may execute
  12 + | in web browsers. You are free to adjust these settings as needed.
  13 + |
  14 + | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
  15 + |
  16 + */
  17 +
  18 + 'paths' => ['api/*', 'sanctum/csrf-cookie'],
  19 +
  20 + 'allowed_methods' => ['*'],
  21 +
  22 + 'allowed_origins' => ['*'],
  23 +
  24 + 'allowed_origins_patterns' => [],
  25 +
  26 + 'allowed_headers' => ['*'],
  27 +
  28 + 'exposed_headers' => [],
  29 +
  30 + 'max_age' => 0,
  31 +
  32 + 'supports_credentials' => false,
  33 +
  34 +];
  1 +<?php
  2 +
  3 +use Illuminate\Support\Str;
  4 +
  5 +return [
  6 +
  7 + /*
  8 + |--------------------------------------------------------------------------
  9 + | Default Database Connection Name
  10 + |--------------------------------------------------------------------------
  11 + |
  12 + | Here you may specify which of the database connections below you wish
  13 + | to use as your default connection for all database work. Of course
  14 + | you may use many connections at once using the Database library.
  15 + |
  16 + */
  17 +
  18 + 'default' => env('DB_CONNECTION', 'mysql'),
  19 +
  20 + /*
  21 + |--------------------------------------------------------------------------
  22 + | Database Connections
  23 + |--------------------------------------------------------------------------
  24 + |
  25 + | Here are each of the database connections setup for your application.
  26 + | Of course, examples of configuring each database platform that is
  27 + | supported by Laravel is shown below to make development simple.
  28 + |
  29 + |
  30 + | All database work in Laravel is done through the PHP PDO facilities
  31 + | so make sure you have the driver for your particular database of
  32 + | choice installed on your machine before you begin development.
  33 + |
  34 + */
  35 +
  36 + 'connections' => [
  37 +
  38 + 'sqlite' => [
  39 + 'driver' => 'sqlite',
  40 + 'url' => env('DATABASE_URL'),
  41 + 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  42 + 'prefix' => '',
  43 + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
  44 + ],
  45 +
  46 + 'mysql' => [
  47 + 'driver' => 'mysql',
  48 + 'url' => env('DATABASE_URL'),
  49 + 'host' => env('DB_HOST', '127.0.0.1'),
  50 + 'port' => env('DB_PORT', '3306'),
  51 + 'database' => env('DB_DATABASE', 'forge'),
  52 + 'username' => env('DB_USERNAME', 'forge'),
  53 + 'password' => env('DB_PASSWORD', ''),
  54 + 'unix_socket' => env('DB_SOCKET', ''),
  55 + 'charset' => 'utf8mb4',
  56 + 'collation' => 'utf8mb4_unicode_ci',
  57 + 'prefix' => '',
  58 + 'prefix_indexes' => true,
  59 + 'strict' => true,
  60 + 'engine' => null,
  61 + 'options' => extension_loaded('pdo_mysql') ? array_filter([
  62 + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
  63 + ]) : [],
  64 + ],
  65 +
  66 + 'pgsql' => [
  67 + 'driver' => 'pgsql',
  68 + 'url' => env('DATABASE_URL'),
  69 + 'host' => env('DB_HOST', '127.0.0.1'),
  70 + 'port' => env('DB_PORT', '5432'),
  71 + 'database' => env('DB_DATABASE', 'forge'),
  72 + 'username' => env('DB_USERNAME', 'forge'),
  73 + 'password' => env('DB_PASSWORD', ''),
  74 + 'charset' => 'utf8',
  75 + 'prefix' => '',
  76 + 'prefix_indexes' => true,
  77 + 'schema' => 'public',
  78 + 'sslmode' => 'prefer',
  79 + ],
  80 +
  81 + 'sqlsrv' => [
  82 + 'driver' => 'sqlsrv',
  83 + 'url' => env('DATABASE_URL'),
  84 + 'host' => env('DB_HOST', 'localhost'),
  85 + 'port' => env('DB_PORT', '1433'),
  86 + 'database' => env('DB_DATABASE', 'forge'),
  87 + 'username' => env('DB_USERNAME', 'forge'),
  88 + 'password' => env('DB_PASSWORD', ''),
  89 + 'charset' => 'utf8',
  90 + 'prefix' => '',
  91 + 'prefix_indexes' => true,
  92 + ],
  93 +
  94 + ],
  95 +
  96 + /*
  97 + |--------------------------------------------------------------------------
  98 + | Migration Repository Table
  99 + |--------------------------------------------------------------------------
  100 + |
  101 + | This table keeps track of all the migrations that have already run for
  102 + | your application. Using this information, we can determine which of
  103 + | the migrations on disk haven't actually been run in the database.
  104 + |
  105 + */
  106 +
  107 + 'migrations' => 'migrations',
  108 +
  109 + /*
  110 + |--------------------------------------------------------------------------
  111 + | Redis Databases
  112 + |--------------------------------------------------------------------------
  113 + |
  114 + | Redis is an open source, fast, and advanced key-value store that also
  115 + | provides a richer body of commands than a typical key-value system
  116 + | such as APC or Memcached. Laravel makes it easy to dig right in.
  117 + |
  118 + */
  119 +
  120 + 'redis' => [
  121 +
  122 + 'client' => env('REDIS_CLIENT', 'phpredis'),
  123 +
  124 + 'options' => [
  125 + 'cluster' => env('REDIS_CLUSTER', 'redis'),
  126 + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
  127 + ],
  128 +
  129 + 'default' => [
  130 + 'url' => env('REDIS_URL'),
  131 + 'host' => env('REDIS_HOST', '127.0.0.1'),
  132 + 'password' => env('REDIS_PASSWORD', null),
  133 + 'port' => env('REDIS_PORT', '6379'),
  134 + 'database' => env('REDIS_DB', '0'),
  135 + ],
  136 +
  137 + 'cache' => [
  138 + 'url' => env('REDIS_URL'),
  139 + 'host' => env('REDIS_HOST', '127.0.0.1'),
  140 + 'password' => env('REDIS_PASSWORD', null),
  141 + 'port' => env('REDIS_PORT', '6379'),
  142 + 'database' => env('REDIS_CACHE_DB', '1'),
  143 + ],
  144 +
  145 + ],
  146 +
  147 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Default Filesystem Disk
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | Here you may specify the default filesystem disk that should be used
  11 + | by the framework. The "local" disk, as well as a variety of cloud
  12 + | based disks are available to your application. Just store away!
  13 + |
  14 + */
  15 +
  16 + 'default' => env('FILESYSTEM_DRIVER', 'local'),
  17 +
  18 + /*
  19 + |--------------------------------------------------------------------------
  20 + | Filesystem Disks
  21 + |--------------------------------------------------------------------------
  22 + |
  23 + | Here you may configure as many filesystem "disks" as you wish, and you
  24 + | may even configure multiple disks of the same driver. Defaults have
  25 + | been setup for each driver as an example of the required options.
  26 + |
  27 + | Supported Drivers: "local", "ftp", "sftp", "s3"
  28 + |
  29 + */
  30 +
  31 + 'disks' => [
  32 +
  33 + 'local' => [
  34 + 'driver' => 'local',
  35 + 'root' => storage_path('app'),
  36 + ],
  37 +
  38 + 'public' => [
  39 + 'driver' => 'local',
  40 + 'root' => storage_path('app/public'),
  41 + 'url' => env('APP_URL').'/storage',
  42 + 'visibility' => 'public',
  43 + ],
  44 +
  45 + 's3' => [
  46 + 'driver' => 's3',
  47 + 'key' => env('AWS_ACCESS_KEY_ID'),
  48 + 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  49 + 'region' => env('AWS_DEFAULT_REGION'),
  50 + 'bucket' => env('AWS_BUCKET'),
  51 + 'url' => env('AWS_URL'),
  52 + 'endpoint' => env('AWS_ENDPOINT'),
  53 + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
  54 + ],
  55 +
  56 + ],
  57 +
  58 + /*
  59 + |--------------------------------------------------------------------------
  60 + | Symbolic Links
  61 + |--------------------------------------------------------------------------
  62 + |
  63 + | Here you may configure the symbolic links that will be created when the
  64 + | `storage:link` Artisan command is executed. The array keys should be
  65 + | the locations of the links and the values should be their targets.
  66 + |
  67 + */
  68 +
  69 + 'links' => [
  70 + public_path('storage') => storage_path('app/public'),
  71 + ],
  72 +
  73 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Default Hash Driver
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This option controls the default hash driver that will be used to hash
  11 + | passwords for your application. By default, the bcrypt algorithm is
  12 + | used; however, you remain free to modify this option if you wish.
  13 + |
  14 + | Supported: "bcrypt", "argon", "argon2id"
  15 + |
  16 + */
  17 +
  18 + 'driver' => 'bcrypt',
  19 +
  20 + /*
  21 + |--------------------------------------------------------------------------
  22 + | Bcrypt Options
  23 + |--------------------------------------------------------------------------
  24 + |
  25 + | Here you may specify the configuration options that should be used when
  26 + | passwords are hashed using the Bcrypt algorithm. This will allow you
  27 + | to control the amount of time it takes to hash the given password.
  28 + |
  29 + */
  30 +
  31 + 'bcrypt' => [
  32 + 'rounds' => env('BCRYPT_ROUNDS', 10),
  33 + ],
  34 +
  35 + /*
  36 + |--------------------------------------------------------------------------
  37 + | Argon Options
  38 + |--------------------------------------------------------------------------
  39 + |
  40 + | Here you may specify the configuration options that should be used when
  41 + | passwords are hashed using the Argon algorithm. These will allow you
  42 + | to control the amount of time it takes to hash the given password.
  43 + |
  44 + */
  45 +
  46 + 'argon' => [
  47 + 'memory' => 65536,
  48 + 'threads' => 1,
  49 + 'time' => 4,
  50 + ],
  51 +
  52 +];
  1 +<?php
  2 +
  3 +use Monolog\Handler\NullHandler;
  4 +use Monolog\Handler\StreamHandler;
  5 +use Monolog\Handler\SyslogUdpHandler;
  6 +
  7 +return [
  8 +
  9 + /*
  10 + |--------------------------------------------------------------------------
  11 + | Default Log Channel
  12 + |--------------------------------------------------------------------------
  13 + |
  14 + | This option defines the default log channel that gets used when writing
  15 + | messages to the logs. The name specified in this option should match
  16 + | one of the channels defined in the "channels" configuration array.
  17 + |
  18 + */
  19 +
  20 + 'default' => env('LOG_CHANNEL', 'stack'),
  21 +
  22 + /*
  23 + |--------------------------------------------------------------------------
  24 + | Deprecations Log Channel
  25 + |--------------------------------------------------------------------------
  26 + |
  27 + | This option controls the log channel that should be used to log warnings
  28 + | regarding deprecated PHP and library features. This allows you to get
  29 + | your application ready for upcoming major versions of dependencies.
  30 + |
  31 + */
  32 +
  33 + 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
  34 +
  35 + /*
  36 + |--------------------------------------------------------------------------
  37 + | Log Channels
  38 + |--------------------------------------------------------------------------
  39 + |
  40 + | Here you may configure the log channels for your application. Out of
  41 + | the box, Laravel uses the Monolog PHP logging library. This gives
  42 + | you a variety of powerful log handlers / formatters to utilize.
  43 + |
  44 + | Available Drivers: "single", "daily", "slack", "syslog",
  45 + | "errorlog", "monolog",
  46 + | "custom", "stack"
  47 + |
  48 + */
  49 +
  50 + 'channels' => [
  51 + 'stack' => [
  52 + 'driver' => 'stack',
  53 + 'channels' => ['single'],
  54 + 'ignore_exceptions' => false,
  55 + ],
  56 +
  57 + 'single' => [
  58 + 'driver' => 'single',
  59 + 'path' => storage_path('logs/laravel.log'),
  60 + 'level' => env('LOG_LEVEL', 'debug'),
  61 + ],
  62 +
  63 + 'daily' => [
  64 + 'driver' => 'daily',
  65 + 'path' => storage_path('logs/laravel.log'),
  66 + 'level' => env('LOG_LEVEL', 'debug'),
  67 + 'days' => 14,
  68 + ],
  69 +
  70 + 'slack' => [
  71 + 'driver' => 'slack',
  72 + 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  73 + 'username' => 'Laravel Log',
  74 + 'emoji' => ':boom:',
  75 + 'level' => env('LOG_LEVEL', 'critical'),
  76 + ],
  77 +
  78 + 'papertrail' => [
  79 + 'driver' => 'monolog',
  80 + 'level' => env('LOG_LEVEL', 'debug'),
  81 + 'handler' => SyslogUdpHandler::class,
  82 + 'handler_with' => [
  83 + 'host' => env('PAPERTRAIL_URL'),
  84 + 'port' => env('PAPERTRAIL_PORT'),
  85 + ],
  86 + ],
  87 +
  88 + 'stderr' => [
  89 + 'driver' => 'monolog',
  90 + 'level' => env('LOG_LEVEL', 'debug'),
  91 + 'handler' => StreamHandler::class,
  92 + 'formatter' => env('LOG_STDERR_FORMATTER'),
  93 + 'with' => [
  94 + 'stream' => 'php://stderr',
  95 + ],
  96 + ],
  97 +
  98 + 'syslog' => [
  99 + 'driver' => 'syslog',
  100 + 'level' => env('LOG_LEVEL', 'debug'),
  101 + ],
  102 +
  103 + 'errorlog' => [
  104 + 'driver' => 'errorlog',
  105 + 'level' => env('LOG_LEVEL', 'debug'),
  106 + ],
  107 +
  108 + 'null' => [
  109 + 'driver' => 'monolog',
  110 + 'handler' => NullHandler::class,
  111 + ],
  112 +
  113 + 'emergency' => [
  114 + 'path' => storage_path('logs/laravel.log'),
  115 + ],
  116 + ],
  117 +
  118 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Default Mailer
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This option controls the default mailer that is used to send any email
  11 + | messages sent by your application. Alternative mailers may be setup
  12 + | and used as needed; however, this mailer will be used by default.
  13 + |
  14 + */
  15 +
  16 + 'default' => env('MAIL_MAILER', 'smtp'),
  17 +
  18 + /*
  19 + |--------------------------------------------------------------------------
  20 + | Mailer Configurations
  21 + |--------------------------------------------------------------------------
  22 + |
  23 + | Here you may configure all of the mailers used by your application plus
  24 + | their respective settings. Several examples have been configured for
  25 + | you and you are free to add your own as your application requires.
  26 + |
  27 + | Laravel supports a variety of mail "transport" drivers to be used while
  28 + | sending an e-mail. You will specify which one you are using for your
  29 + | mailers below. You are free to add additional mailers as required.
  30 + |
  31 + | Supported: "smtp", "sendmail", "mailgun", "ses",
  32 + | "postmark", "log", "array", "failover"
  33 + |
  34 + */
  35 +
  36 + 'mailers' => [
  37 + 'smtp' => [
  38 + 'transport' => 'smtp',
  39 + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
  40 + 'port' => env('MAIL_PORT', 587),
  41 + 'encryption' => env('MAIL_ENCRYPTION', 'tls'),
  42 + 'username' => env('MAIL_USERNAME'),
  43 + 'password' => env('MAIL_PASSWORD'),
  44 + 'timeout' => null,
  45 + 'auth_mode' => null,
  46 + ],
  47 +
  48 + 'ses' => [
  49 + 'transport' => 'ses',
  50 + ],
  51 +
  52 + 'mailgun' => [
  53 + 'transport' => 'mailgun',
  54 + ],
  55 +
  56 + 'postmark' => [
  57 + 'transport' => 'postmark',
  58 + ],
  59 +
  60 + 'sendmail' => [
  61 + 'transport' => 'sendmail',
  62 + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'),
  63 + ],
  64 +
  65 + 'log' => [
  66 + 'transport' => 'log',
  67 + 'channel' => env('MAIL_LOG_CHANNEL'),
  68 + ],
  69 +
  70 + 'array' => [
  71 + 'transport' => 'array',
  72 + ],
  73 +
  74 + 'failover' => [
  75 + 'transport' => 'failover',
  76 + 'mailers' => [
  77 + 'smtp',
  78 + 'log',
  79 + ],
  80 + ],
  81 + ],
  82 +
  83 + /*
  84 + |--------------------------------------------------------------------------
  85 + | Global "From" Address
  86 + |--------------------------------------------------------------------------
  87 + |
  88 + | You may wish for all e-mails sent by your application to be sent from
  89 + | the same address. Here, you may specify a name and address that is
  90 + | used globally for all e-mails that are sent by your application.
  91 + |
  92 + */
  93 +
  94 + 'from' => [
  95 + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
  96 + 'name' => env('MAIL_FROM_NAME', 'Example'),
  97 + ],
  98 +
  99 + /*
  100 + |--------------------------------------------------------------------------
  101 + | Markdown Mail Settings
  102 + |--------------------------------------------------------------------------
  103 + |
  104 + | If you are using Markdown based email rendering, you may configure your
  105 + | theme and component paths here, allowing you to customize the design
  106 + | of the emails. Or, you may simply stick with the Laravel defaults!
  107 + |
  108 + */
  109 +
  110 + 'markdown' => [
  111 + 'theme' => 'default',
  112 +
  113 + 'paths' => [
  114 + resource_path('views/vendor/mail'),
  115 + ],
  116 + ],
  117 +
  118 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Default Queue Connection Name
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | Laravel's queue API supports an assortment of back-ends via a single
  11 + | API, giving you convenient access to each back-end using the same
  12 + | syntax for every one. Here you may define a default connection.
  13 + |
  14 + */
  15 +
  16 + 'default' => env('QUEUE_CONNECTION', 'sync'),
  17 +
  18 + /*
  19 + |--------------------------------------------------------------------------
  20 + | Queue Connections
  21 + |--------------------------------------------------------------------------
  22 + |
  23 + | Here you may configure the connection information for each server that
  24 + | is used by your application. A default configuration has been added
  25 + | for each back-end shipped with Laravel. You are free to add more.
  26 + |
  27 + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
  28 + |
  29 + */
  30 +
  31 + 'connections' => [
  32 +
  33 + 'sync' => [
  34 + 'driver' => 'sync',
  35 + ],
  36 +
  37 + 'database' => [
  38 + 'driver' => 'database',
  39 + 'table' => 'jobs',
  40 + 'queue' => 'default',
  41 + 'retry_after' => 90,
  42 + 'after_commit' => false,
  43 + ],
  44 +
  45 + 'beanstalkd' => [
  46 + 'driver' => 'beanstalkd',
  47 + 'host' => 'localhost',
  48 + 'queue' => 'default',
  49 + 'retry_after' => 90,
  50 + 'block_for' => 0,
  51 + 'after_commit' => false,
  52 + ],
  53 +
  54 + 'sqs' => [
  55 + 'driver' => 'sqs',
  56 + 'key' => env('AWS_ACCESS_KEY_ID'),
  57 + 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  58 + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
  59 + 'queue' => env('SQS_QUEUE', 'default'),
  60 + 'suffix' => env('SQS_SUFFIX'),
  61 + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  62 + 'after_commit' => false,
  63 + ],
  64 +
  65 + 'redis' => [
  66 + 'driver' => 'redis',
  67 + 'connection' => 'default',
  68 + 'queue' => env('REDIS_QUEUE', 'default'),
  69 + 'retry_after' => 90,
  70 + 'block_for' => null,
  71 + 'after_commit' => false,
  72 + ],
  73 +
  74 + ],
  75 +
  76 + /*
  77 + |--------------------------------------------------------------------------
  78 + | Failed Queue Jobs
  79 + |--------------------------------------------------------------------------
  80 + |
  81 + | These options configure the behavior of failed queue job logging so you
  82 + | can control which database and table are used to store the jobs that
  83 + | have failed. You may change them to any database / table you wish.
  84 + |
  85 + */
  86 +
  87 + 'failed' => [
  88 + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
  89 + 'database' => env('DB_CONNECTION', 'mysql'),
  90 + 'table' => 'failed_jobs',
  91 + ],
  92 +
  93 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Stateful Domains
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | Requests from the following domains / hosts will receive stateful API
  11 + | authentication cookies. Typically, these should include your local
  12 + | and production domains which access your API via a frontend SPA.
  13 + |
  14 + */
  15 +
  16 + 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
  17 + '%s%s',
  18 + 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
  19 + env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
  20 + ))),
  21 +
  22 + /*
  23 + |--------------------------------------------------------------------------
  24 + | Sanctum Guards
  25 + |--------------------------------------------------------------------------
  26 + |
  27 + | This array contains the authentication guards that will be checked when
  28 + | Sanctum is trying to authenticate a request. If none of these guards
  29 + | are able to authenticate the request, Sanctum will use the bearer
  30 + | token that's present on an incoming request for authentication.
  31 + |
  32 + */
  33 +
  34 + 'guard' => ['web'],
  35 +
  36 + /*
  37 + |--------------------------------------------------------------------------
  38 + | Expiration Minutes
  39 + |--------------------------------------------------------------------------
  40 + |
  41 + | This value controls the number of minutes until an issued token will be
  42 + | considered expired. If this value is null, personal access tokens do
  43 + | not expire. This won't tweak the lifetime of first-party sessions.
  44 + |
  45 + */
  46 +
  47 + 'expiration' => null,
  48 +
  49 + /*
  50 + |--------------------------------------------------------------------------
  51 + | Sanctum Middleware
  52 + |--------------------------------------------------------------------------
  53 + |
  54 + | When authenticating your first-party SPA with Sanctum you may need to
  55 + | customize some of the middleware Sanctum uses while processing the
  56 + | request. You may change the middleware listed below as required.
  57 + |
  58 + */
  59 +
  60 + 'middleware' => [
  61 + 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
  62 + 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
  63 + ],
  64 +
  65 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Third Party Services
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | This file is for storing the credentials for third party services such
  11 + | as Mailgun, Postmark, AWS and more. This file provides the de facto
  12 + | location for this type of information, allowing packages to have
  13 + | a conventional file to locate the various service credentials.
  14 + |
  15 + */
  16 +
  17 + 'mailgun' => [
  18 + 'domain' => env('MAILGUN_DOMAIN'),
  19 + 'secret' => env('MAILGUN_SECRET'),
  20 + 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
  21 + ],
  22 +
  23 + 'postmark' => [
  24 + 'token' => env('POSTMARK_TOKEN'),
  25 + ],
  26 +
  27 + 'ses' => [
  28 + 'key' => env('AWS_ACCESS_KEY_ID'),
  29 + 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  30 + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
  31 + ],
  32 +
  33 +];
  1 +<?php
  2 +
  3 +use Illuminate\Support\Str;
  4 +
  5 +return [
  6 +
  7 + /*
  8 + |--------------------------------------------------------------------------
  9 + | Default Session Driver
  10 + |--------------------------------------------------------------------------
  11 + |
  12 + | This option controls the default session "driver" that will be used on
  13 + | requests. By default, we will use the lightweight native driver but
  14 + | you may specify any of the other wonderful drivers provided here.
  15 + |
  16 + | Supported: "file", "cookie", "database", "apc",
  17 + | "memcached", "redis", "dynamodb", "array"
  18 + |
  19 + */
  20 +
  21 + 'driver' => env('SESSION_DRIVER', 'file'),
  22 +
  23 + /*
  24 + |--------------------------------------------------------------------------
  25 + | Session Lifetime
  26 + |--------------------------------------------------------------------------
  27 + |
  28 + | Here you may specify the number of minutes that you wish the session
  29 + | to be allowed to remain idle before it expires. If you want them
  30 + | to immediately expire on the browser closing, set that option.
  31 + |
  32 + */
  33 +
  34 + 'lifetime' => env('SESSION_LIFETIME', 120),
  35 +
  36 + 'expire_on_close' => false,
  37 +
  38 + /*
  39 + |--------------------------------------------------------------------------
  40 + | Session Encryption
  41 + |--------------------------------------------------------------------------
  42 + |
  43 + | This option allows you to easily specify that all of your session data
  44 + | should be encrypted before it is stored. All encryption will be run
  45 + | automatically by Laravel and you can use the Session like normal.
  46 + |
  47 + */
  48 +
  49 + 'encrypt' => false,
  50 +
  51 + /*
  52 + |--------------------------------------------------------------------------
  53 + | Session File Location
  54 + |--------------------------------------------------------------------------
  55 + |
  56 + | When using the native session driver, we need a location where session
  57 + | files may be stored. A default has been set for you but a different
  58 + | location may be specified. This is only needed for file sessions.
  59 + |
  60 + */
  61 +
  62 + 'files' => storage_path('framework/sessions'),
  63 +
  64 + /*
  65 + |--------------------------------------------------------------------------
  66 + | Session Database Connection
  67 + |--------------------------------------------------------------------------
  68 + |
  69 + | When using the "database" or "redis" session drivers, you may specify a
  70 + | connection that should be used to manage these sessions. This should
  71 + | correspond to a connection in your database configuration options.
  72 + |
  73 + */
  74 +
  75 + 'connection' => env('SESSION_CONNECTION', null),
  76 +
  77 + /*
  78 + |--------------------------------------------------------------------------
  79 + | Session Database Table
  80 + |--------------------------------------------------------------------------
  81 + |
  82 + | When using the "database" session driver, you may specify the table we
  83 + | should use to manage the sessions. Of course, a sensible default is
  84 + | provided for you; however, you are free to change this as needed.
  85 + |
  86 + */
  87 +
  88 + 'table' => 'sessions',
  89 +
  90 + /*
  91 + |--------------------------------------------------------------------------
  92 + | Session Cache Store
  93 + |--------------------------------------------------------------------------
  94 + |
  95 + | While using one of the framework's cache driven session backends you may
  96 + | list a cache store that should be used for these sessions. This value
  97 + | must match with one of the application's configured cache "stores".
  98 + |
  99 + | Affects: "apc", "dynamodb", "memcached", "redis"
  100 + |
  101 + */
  102 +
  103 + 'store' => env('SESSION_STORE', null),
  104 +
  105 + /*
  106 + |--------------------------------------------------------------------------
  107 + | Session Sweeping Lottery
  108 + |--------------------------------------------------------------------------
  109 + |
  110 + | Some session drivers must manually sweep their storage location to get
  111 + | rid of old sessions from storage. Here are the chances that it will
  112 + | happen on a given request. By default, the odds are 2 out of 100.
  113 + |
  114 + */
  115 +
  116 + 'lottery' => [2, 100],
  117 +
  118 + /*
  119 + |--------------------------------------------------------------------------
  120 + | Session Cookie Name
  121 + |--------------------------------------------------------------------------
  122 + |
  123 + | Here you may change the name of the cookie used to identify a session
  124 + | instance by ID. The name specified here will get used every time a
  125 + | new session cookie is created by the framework for every driver.
  126 + |
  127 + */
  128 +
  129 + 'cookie' => env(
  130 + 'SESSION_COOKIE',
  131 + Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
  132 + ),
  133 +
  134 + /*
  135 + |--------------------------------------------------------------------------
  136 + | Session Cookie Path
  137 + |--------------------------------------------------------------------------
  138 + |
  139 + | The session cookie path determines the path for which the cookie will
  140 + | be regarded as available. Typically, this will be the root path of
  141 + | your application but you are free to change this when necessary.
  142 + |
  143 + */
  144 +
  145 + 'path' => '/',
  146 +
  147 + /*
  148 + |--------------------------------------------------------------------------
  149 + | Session Cookie Domain
  150 + |--------------------------------------------------------------------------
  151 + |
  152 + | Here you may change the domain of the cookie used to identify a session
  153 + | in your application. This will determine which domains the cookie is
  154 + | available to in your application. A sensible default has been set.
  155 + |
  156 + */
  157 +
  158 + 'domain' => env('SESSION_DOMAIN', null),
  159 +
  160 + /*
  161 + |--------------------------------------------------------------------------
  162 + | HTTPS Only Cookies
  163 + |--------------------------------------------------------------------------
  164 + |
  165 + | By setting this option to true, session cookies will only be sent back
  166 + | to the server if the browser has a HTTPS connection. This will keep
  167 + | the cookie from being sent to you when it can't be done securely.
  168 + |
  169 + */
  170 +
  171 + 'secure' => env('SESSION_SECURE_COOKIE'),
  172 +
  173 + /*
  174 + |--------------------------------------------------------------------------
  175 + | HTTP Access Only
  176 + |--------------------------------------------------------------------------
  177 + |
  178 + | Setting this value to true will prevent JavaScript from accessing the
  179 + | value of the cookie and the cookie will only be accessible through
  180 + | the HTTP protocol. You are free to modify this option if needed.
  181 + |
  182 + */
  183 +
  184 + 'http_only' => true,
  185 +
  186 + /*
  187 + |--------------------------------------------------------------------------
  188 + | Same-Site Cookies
  189 + |--------------------------------------------------------------------------
  190 + |
  191 + | This option determines how your cookies behave when cross-site requests
  192 + | take place, and can be used to mitigate CSRF attacks. By default, we
  193 + | will set this value to "lax" since this is a secure default value.
  194 + |
  195 + | Supported: "lax", "strict", "none", null
  196 + |
  197 + */
  198 +
  199 + 'same_site' => 'lax',
  200 +
  201 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | View Storage Paths
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | Most templating systems load templates from disk. Here you may specify
  11 + | an array of paths that should be checked for your views. Of course
  12 + | the usual Laravel view path has already been registered for you.
  13 + |
  14 + */
  15 +
  16 + 'paths' => [
  17 + resource_path('views'),
  18 + ],
  19 +
  20 + /*
  21 + |--------------------------------------------------------------------------
  22 + | Compiled View Path
  23 + |--------------------------------------------------------------------------
  24 + |
  25 + | This option determines where all the compiled Blade templates will be
  26 + | stored for your application. Typically, this is within the storage
  27 + | directory. However, as usual, you are free to change this value.
  28 + |
  29 + */
  30 +
  31 + 'compiled' => env(
  32 + 'VIEW_COMPILED_PATH',
  33 + realpath(storage_path('framework/views'))
  34 + ),
  35 +
  36 +];
  1 +<?php
  2 +
  3 +namespace Database\Factories;
  4 +
  5 +use Illuminate\Database\Eloquent\Factories\Factory;
  6 +use Illuminate\Support\Str;
  7 +
  8 +class UserFactory extends Factory
  9 +{
  10 + /**
  11 + * Define the model's default state.
  12 + *
  13 + * @return array
  14 + */
  15 + public function definition()
  16 + {
  17 + return [
  18 + 'name' => $this->faker->name(),
  19 + 'email' => $this->faker->unique()->safeEmail(),
  20 + 'email_verified_at' => now(),
  21 + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
  22 + 'remember_token' => Str::random(10),
  23 + ];
  24 + }
  25 +
  26 + /**
  27 + * Indicate that the model's email address should be unverified.
  28 + *
  29 + * @return \Illuminate\Database\Eloquent\Factories\Factory
  30 + */
  31 + public function unverified()
  32 + {
  33 + return $this->state(function (array $attributes) {
  34 + return [
  35 + 'email_verified_at' => null,
  36 + ];
  37 + });
  38 + }
  39 +}
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +class CreateUsersTable extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('users', function (Blueprint $table) {
  17 + $table->id();
  18 + $table->string('name', 64);
  19 + $table->string('email', 64)->unique();
  20 + $table->timestamp('email_verified_at')->nullable();
  21 + $table->string('password', 64);
  22 + $table->rememberToken();
  23 + $table->timestamps();
  24 + });
  25 + }
  26 +
  27 + /**
  28 + * Reverse the migrations.
  29 + *
  30 + * @return void
  31 + */
  32 + public function down()
  33 + {
  34 + Schema::dropIfExists('users');
  35 + }
  36 +}
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +class CreateFailedJobsTable extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('failed_jobs', function (Blueprint $table) {
  17 + $table->id();
  18 + $table->string('uuid', 64)->unique();
  19 + $table->text('connection');
  20 + $table->text('queue');
  21 + $table->longText('payload');
  22 + $table->longText('exception');
  23 + $table->timestamp('failed_at')->useCurrent();
  24 + });
  25 + }
  26 +
  27 + /**
  28 + * Reverse the migrations.
  29 + *
  30 + * @return void
  31 + */
  32 + public function down()
  33 + {
  34 + Schema::dropIfExists('failed_jobs');
  35 + }
  36 +}
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +class CreatePersonalAccessTokensTable extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('personal_access_tokens', function (Blueprint $table) {
  17 + $table->id();
  18 + $table->morphs('tokenable');
  19 + $table->string('name', 64);
  20 + $table->string('token', 64)->unique();
  21 + $table->text('abilities')->nullable();
  22 + $table->timestamp('last_used_at')->nullable();
  23 + $table->timestamps();
  24 + });
  25 + }
  26 +
  27 + /**
  28 + * Reverse the migrations.
  29 + *
  30 + * @return void
  31 + */
  32 + public function down()
  33 + {
  34 + Schema::dropIfExists('personal_access_tokens');
  35 + }
  36 +}
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +class CreateBtSitesTable extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('bt_sites', function (Blueprint $table) {
  17 + $table->id('id')->primary();
  18 + $table->integer('site_id')->default(0)->comment('站点ID');
  19 + $table->string('domain', 200)->comment('域名 domain')->unique();
  20 + $table->tinyInteger('ssl_open')->default(0)->comment('SSL是否开启 1:开启');
  21 + $table->tinyInteger('ssl_status')->default(0)->comment('SSL是否已经生成 1:生成成功');
  22 + $table->tinyInteger('ssl_auto')->default(0)->comment('SSL是否需要续签 1:续签');
  23 + $table->tinyInteger('ssl_auto_day')->default(0)->comment('SSL提前续签天数');
  24 + $table->tinyInteger('status')->default(1)->comment('站点状态 1:开启, 2:关闭');
  25 + $table->tinyInteger('is_del')->default(0)->comment('站点是否删除 0:正常, 1:删除');
  26 + $table->timestamps();
  27 + });
  28 + \Illuminate\Support\Facades\DB::statement("alter table `bt_sites` comment '程序生成站点表'");
  29 + }
  30 +
  31 + /**
  32 + * Reverse the migrations.
  33 + *
  34 + * @return void
  35 + */
  36 + public function down()
  37 + {
  38 + Schema::dropIfExists('bt_sites');
  39 + }
  40 +}
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +class CreateBtEventsTable extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::create('bt_events', function (Blueprint $table) {
  17 + $table->id();
  18 + $table->tinyInteger('type')->default(0)->comment('事件类型');
  19 + $table->text('param')->comment('事件参数');
  20 + $table->tinyInteger('status')->default(0)->comment('事件状态');
  21 + $table->tinyInteger('times')->default(0)->comment('处理次数');
  22 + $table->string('source', 50)->default(null)->comment('来源');
  23 + $table->timestamps();
  24 + });
  25 + }
  26 +
  27 + /**
  28 + * Reverse the migrations.
  29 + *
  30 + * @return void
  31 + */
  32 + public function down()
  33 + {
  34 + Schema::dropIfExists('bt_events');
  35 + }
  36 +}
  1 +<?php
  2 +
  3 +namespace Database\Seeders;
  4 +
  5 +use Illuminate\Database\Seeder;
  6 +
  7 +class DatabaseSeeder extends Seeder
  8 +{
  9 + /**
  10 + * Seed the application's database.
  11 + *
  12 + * @return void
  13 + */
  14 + public function run()
  15 + {
  16 + // \App\Models\User::factory(10)->create();
  17 + }
  18 +}
  1 +{
  2 + "private": true,
  3 + "scripts": {
  4 + "dev": "npm run development",
  5 + "development": "mix",
  6 + "watch": "mix watch",
  7 + "watch-poll": "mix watch -- --watch-options-poll=1000",
  8 + "hot": "mix watch --hot",
  9 + "prod": "npm run production",
  10 + "production": "mix --production"
  11 + },
  12 + "devDependencies": {
  13 + "axios": "^0.21",
  14 + "laravel-mix": "^6.0.6",
  15 + "lodash": "^4.17.19",
  16 + "postcss": "^8.1.14"
  17 + }
  18 +}
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
  4 + bootstrap="vendor/autoload.php"
  5 + colors="true"
  6 +>
  7 + <testsuites>
  8 + <testsuite name="Unit">
  9 + <directory suffix="Test.php">./tests/Unit</directory>
  10 + </testsuite>
  11 + <testsuite name="Feature">
  12 + <directory suffix="Test.php">./tests/Feature</directory>
  13 + </testsuite>
  14 + </testsuites>
  15 + <coverage processUncoveredFiles="true">
  16 + <include>
  17 + <directory suffix=".php">./app</directory>
  18 + </include>
  19 + </coverage>
  20 + <php>
  21 + <server name="APP_ENV" value="testing"/>
  22 + <server name="BCRYPT_ROUNDS" value="4"/>
  23 + <server name="CACHE_DRIVER" value="array"/>
  24 + <!-- <server name="DB_CONNECTION" value="sqlite"/> -->
  25 + <!-- <server name="DB_DATABASE" value=":memory:"/> -->
  26 + <server name="MAIL_MAILER" value="array"/>
  27 + <server name="QUEUE_CONNECTION" value="sync"/>
  28 + <server name="SESSION_DRIVER" value="array"/>
  29 + <server name="TELESCOPE_ENABLED" value="false"/>
  30 + </php>
  31 +</phpunit>
  1 +<IfModule mod_rewrite.c>
  2 + <IfModule mod_negotiation.c>
  3 + Options -MultiViews -Indexes
  4 + </IfModule>
  5 +
  6 + RewriteEngine On
  7 +
  8 + # Handle Authorization Header
  9 + RewriteCond %{HTTP:Authorization} .
  10 + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  11 +
  12 + # Redirect Trailing Slashes If Not A Folder...
  13 + RewriteCond %{REQUEST_FILENAME} !-d
  14 + RewriteCond %{REQUEST_URI} (.+)/$
  15 + RewriteRule ^ %1 [L,R=301]
  16 +
  17 + # Send Requests To Front Controller...
  18 + RewriteCond %{REQUEST_FILENAME} !-d
  19 + RewriteCond %{REQUEST_FILENAME} !-f
  20 + RewriteRule ^ index.php [L]
  21 +</IfModule>
  1 +<?php
  2 +
  3 +use Illuminate\Contracts\Http\Kernel;
  4 +use Illuminate\Http\Request;
  5 +
  6 +define('LARAVEL_START', microtime(true));
  7 +
  8 +/*
  9 +|--------------------------------------------------------------------------
  10 +| Check If The Application Is Under Maintenance
  11 +|--------------------------------------------------------------------------
  12 +|
  13 +| If the application is in maintenance / demo mode via the "down" command
  14 +| we will load this file so that any pre-rendered content can be shown
  15 +| instead of starting the framework, which could cause an exception.
  16 +|
  17 +*/
  18 +
  19 +if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
  20 + require $maintenance;
  21 +}
  22 +
  23 +/*
  24 +|--------------------------------------------------------------------------
  25 +| Register The Auto Loader
  26 +|--------------------------------------------------------------------------
  27 +|
  28 +| Composer provides a convenient, automatically generated class loader for
  29 +| this application. We just need to utilize it! We'll simply require it
  30 +| into the script here so we don't need to manually load our classes.
  31 +|
  32 +*/
  33 +
  34 +require __DIR__.'/../vendor/autoload.php';
  35 +
  36 +/*
  37 +|--------------------------------------------------------------------------
  38 +| Run The Application
  39 +|--------------------------------------------------------------------------
  40 +|
  41 +| Once we have the application, we can handle the incoming request using
  42 +| the application's HTTP kernel. Then, we will send the response back
  43 +| to this client's browser, allowing them to enjoy our application.
  44 +|
  45 +*/
  46 +
  47 +$app = require_once __DIR__.'/../bootstrap/app.php';
  48 +
  49 +$kernel = $app->make(Kernel::class);
  50 +
  51 +$response = $kernel->handle(
  52 + $request = Request::capture()
  53 +)->send();
  54 +
  55 +$kernel->terminate($request, $response);
  1 +User-agent: *
  2 +Disallow:
  1 +require('./bootstrap');
  1 +window._ = require('lodash');
  2 +
  3 +/**
  4 + * We'll load the axios HTTP library which allows us to easily issue requests
  5 + * to our Laravel back-end. This library automatically handles sending the
  6 + * CSRF token as a header based on the value of the "XSRF" token cookie.
  7 + */
  8 +
  9 +window.axios = require('axios');
  10 +
  11 +window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  12 +
  13 +/**
  14 + * Echo exposes an expressive API for subscribing to channels and listening
  15 + * for events that are broadcast by Laravel. Echo and event broadcasting
  16 + * allows your team to easily build robust real-time web applications.
  17 + */
  18 +
  19 +// import Echo from 'laravel-echo';
  20 +
  21 +// window.Pusher = require('pusher-js');
  22 +
  23 +// window.Echo = new Echo({
  24 +// broadcaster: 'pusher',
  25 +// key: process.env.MIX_PUSHER_APP_KEY,
  26 +// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
  27 +// forceTLS: true
  28 +// });
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Authentication Language Lines
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | The following language lines are used during authentication for various
  11 + | messages that we need to display to the user. You are free to modify
  12 + | these language lines according to your application's requirements.
  13 + |
  14 + */
  15 +
  16 + 'failed' => 'These credentials do not match our records.',
  17 + 'password' => 'The provided password is incorrect.',
  18 + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
  19 +
  20 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Pagination Language Lines
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | The following language lines are used by the paginator library to build
  11 + | the simple pagination links. You are free to change them to anything
  12 + | you want to customize your views to better match your application.
  13 + |
  14 + */
  15 +
  16 + 'previous' => '&laquo; Previous',
  17 + 'next' => 'Next &raquo;',
  18 +
  19 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Password Reset Language Lines
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | The following language lines are the default lines which match reasons
  11 + | that are given by the password broker for a password update attempt
  12 + | has failed, such as for an invalid token or invalid new password.
  13 + |
  14 + */
  15 +
  16 + 'reset' => 'Your password has been reset!',
  17 + 'sent' => 'We have emailed your password reset link!',
  18 + 'throttled' => 'Please wait before retrying.',
  19 + 'token' => 'This password reset token is invalid.',
  20 + 'user' => "We can't find a user with that email address.",
  21 +
  22 +];
  1 +<?php
  2 +
  3 +return [
  4 +
  5 + /*
  6 + |--------------------------------------------------------------------------
  7 + | Validation Language Lines
  8 + |--------------------------------------------------------------------------
  9 + |
  10 + | The following language lines contain the default error messages used by
  11 + | the validator class. Some of these rules have multiple versions such
  12 + | as the size rules. Feel free to tweak each of these messages here.
  13 + |
  14 + */
  15 +
  16 + 'accepted' => 'The :attribute must be accepted.',
  17 + 'accepted_if' => 'The :attribute must be accepted when :other is :value.',
  18 + 'active_url' => 'The :attribute is not a valid URL.',
  19 + 'after' => 'The :attribute must be a date after :date.',
  20 + 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
  21 + 'alpha' => 'The :attribute must only contain letters.',
  22 + 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.',
  23 + 'alpha_num' => 'The :attribute must only contain letters and numbers.',
  24 + 'array' => 'The :attribute must be an array.',
  25 + 'before' => 'The :attribute must be a date before :date.',
  26 + 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
  27 + 'between' => [
  28 + 'numeric' => 'The :attribute must be between :min and :max.',
  29 + 'file' => 'The :attribute must be between :min and :max kilobytes.',
  30 + 'string' => 'The :attribute must be between :min and :max characters.',
  31 + 'array' => 'The :attribute must have between :min and :max items.',
  32 + ],
  33 + 'boolean' => 'The :attribute field must be true or false.',
  34 + 'confirmed' => 'The :attribute confirmation does not match.',
  35 + 'current_password' => 'The password is incorrect.',
  36 + 'date' => 'The :attribute is not a valid date.',
  37 + 'date_equals' => 'The :attribute must be a date equal to :date.',
  38 + 'date_format' => 'The :attribute does not match the format :format.',
  39 + 'declined' => 'The :attribute must be declined.',
  40 + 'declined_if' => 'The :attribute must be declined when :other is :value.',
  41 + 'different' => 'The :attribute and :other must be different.',
  42 + 'digits' => 'The :attribute must be :digits digits.',
  43 + 'digits_between' => 'The :attribute must be between :min and :max digits.',
  44 + 'dimensions' => 'The :attribute has invalid image dimensions.',
  45 + 'distinct' => 'The :attribute field has a duplicate value.',
  46 + 'email' => 'The :attribute must be a valid email address.',
  47 + 'ends_with' => 'The :attribute must end with one of the following: :values.',
  48 + 'enum' => 'The selected :attribute is invalid.',
  49 + 'exists' => 'The selected :attribute is invalid.',
  50 + 'file' => 'The :attribute must be a file.',
  51 + 'filled' => 'The :attribute field must have a value.',
  52 + 'gt' => [
  53 + 'numeric' => 'The :attribute must be greater than :value.',
  54 + 'file' => 'The :attribute must be greater than :value kilobytes.',
  55 + 'string' => 'The :attribute must be greater than :value characters.',
  56 + 'array' => 'The :attribute must have more than :value items.',
  57 + ],
  58 + 'gte' => [
  59 + 'numeric' => 'The :attribute must be greater than or equal to :value.',
  60 + 'file' => 'The :attribute must be greater than or equal to :value kilobytes.',
  61 + 'string' => 'The :attribute must be greater than or equal to :value characters.',
  62 + 'array' => 'The :attribute must have :value items or more.',
  63 + ],
  64 + 'image' => 'The :attribute must be an image.',
  65 + 'in' => 'The selected :attribute is invalid.',
  66 + 'in_array' => 'The :attribute field does not exist in :other.',
  67 + 'integer' => 'The :attribute must be an integer.',
  68 + 'ip' => 'The :attribute must be a valid IP address.',
  69 + 'ipv4' => 'The :attribute must be a valid IPv4 address.',
  70 + 'ipv6' => 'The :attribute must be a valid IPv6 address.',
  71 + 'json' => 'The :attribute must be a valid JSON string.',
  72 + 'lt' => [
  73 + 'numeric' => 'The :attribute must be less than :value.',
  74 + 'file' => 'The :attribute must be less than :value kilobytes.',
  75 + 'string' => 'The :attribute must be less than :value characters.',
  76 + 'array' => 'The :attribute must have less than :value items.',
  77 + ],
  78 + 'lte' => [
  79 + 'numeric' => 'The :attribute must be less than or equal to :value.',
  80 + 'file' => 'The :attribute must be less than or equal to :value kilobytes.',
  81 + 'string' => 'The :attribute must be less than or equal to :value characters.',
  82 + 'array' => 'The :attribute must not have more than :value items.',
  83 + ],
  84 + 'mac_address' => 'The :attribute must be a valid MAC address.',
  85 + 'max' => [
  86 + 'numeric' => 'The :attribute must not be greater than :max.',
  87 + 'file' => 'The :attribute must not be greater than :max kilobytes.',
  88 + 'string' => 'The :attribute must not be greater than :max characters.',
  89 + 'array' => 'The :attribute must not have more than :max items.',
  90 + ],
  91 + 'mimes' => 'The :attribute must be a file of type: :values.',
  92 + 'mimetypes' => 'The :attribute must be a file of type: :values.',
  93 + 'min' => [
  94 + 'numeric' => 'The :attribute must be at least :min.',
  95 + 'file' => 'The :attribute must be at least :min kilobytes.',
  96 + 'string' => 'The :attribute must be at least :min characters.',
  97 + 'array' => 'The :attribute must have at least :min items.',
  98 + ],
  99 + 'multiple_of' => 'The :attribute must be a multiple of :value.',
  100 + 'not_in' => 'The selected :attribute is invalid.',
  101 + 'not_regex' => 'The :attribute format is invalid.',
  102 + 'numeric' => 'The :attribute must be a number.',
  103 + 'password' => 'The password is incorrect.',
  104 + 'present' => 'The :attribute field must be present.',
  105 + 'prohibited' => 'The :attribute field is prohibited.',
  106 + 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',
  107 + 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.',
  108 + 'prohibits' => 'The :attribute field prohibits :other from being present.',
  109 + 'regex' => 'The :attribute format is invalid.',
  110 + 'required' => 'The :attribute field is required.',
  111 + 'required_array_keys' => 'The :attribute field must contain entries for: :values.',
  112 + 'required_if' => 'The :attribute field is required when :other is :value.',
  113 + 'required_unless' => 'The :attribute field is required unless :other is in :values.',
  114 + 'required_with' => 'The :attribute field is required when :values is present.',
  115 + 'required_with_all' => 'The :attribute field is required when :values are present.',
  116 + 'required_without' => 'The :attribute field is required when :values is not present.',
  117 + 'required_without_all' => 'The :attribute field is required when none of :values are present.',
  118 + 'same' => 'The :attribute and :other must match.',
  119 + 'size' => [
  120 + 'numeric' => 'The :attribute must be :size.',
  121 + 'file' => 'The :attribute must be :size kilobytes.',
  122 + 'string' => 'The :attribute must be :size characters.',
  123 + 'array' => 'The :attribute must contain :size items.',
  124 + ],
  125 + 'starts_with' => 'The :attribute must start with one of the following: :values.',
  126 + 'string' => 'The :attribute must be a string.',
  127 + 'timezone' => 'The :attribute must be a valid timezone.',
  128 + 'unique' => 'The :attribute has already been taken.',
  129 + 'uploaded' => 'The :attribute failed to upload.',
  130 + 'url' => 'The :attribute must be a valid URL.',
  131 + 'uuid' => 'The :attribute must be a valid UUID.',
  132 +
  133 + /*
  134 + |--------------------------------------------------------------------------
  135 + | Custom Validation Language Lines
  136 + |--------------------------------------------------------------------------
  137 + |
  138 + | Here you may specify custom validation messages for attributes using the
  139 + | convention "attribute.rule" to name the lines. This makes it quick to
  140 + | specify a specific custom language line for a given attribute rule.
  141 + |
  142 + */
  143 +
  144 + 'custom' => [
  145 + 'attribute-name' => [
  146 + 'rule-name' => 'custom-message',
  147 + ],
  148 + ],
  149 +
  150 + /*
  151 + |--------------------------------------------------------------------------
  152 + | Custom Validation Attributes
  153 + |--------------------------------------------------------------------------
  154 + |
  155 + | The following language lines are used to swap our attribute placeholder
  156 + | with something more reader friendly such as "E-Mail Address" instead
  157 + | of "email". This simply helps us make our message more expressive.
  158 + |
  159 + */
  160 +
  161 + 'attributes' => [],
  162 +
  163 +];