michielkempen / smoothy-package
一个用于启动Smoothy应用的Laravel 5包
0.7.0
2018-02-12 22:49 UTC
Requires
- php: ^7.0
- cocur/slugify: 2.*
- devitek/yaml-translation: 3.*
- guzzlehttp/guzzle: ^6.2
- illuminate/http: 5.4.*
- illuminate/support: 5.4.*
- jakeasmith/http_build_url: ^1.0
- laravelcollective/html: ^5.2
- league/glide-laravel: ^1.0
- predis/predis: ^1.1
- spatie/laravel-collection-macros: ^2.1
- spatie/laravel-cookie-consent: ^1.8
This package is auto-updated.
Last update: 2023-11-25 05:33:10 UTC
README
一个用于启动Smoothy应用的Laravel 5包。
安装
您可以使用composer安装此包:
composer require michielkempen/smoothy-package
服务提供者
从config/app.php
中移除以下代码:
'providers' => [ App\Providers\RouteServiceProvider::class, ]
将以下代码添加到config/app.php
中:
'providers' => [ \Smoothy\Providers\SmoothyServiceProvider::class, ]
中间件
将以下代码添加到app/Http/Kernel.php
中:
protected $middlewareGroups = [ 'web' => [ \Smoothy\Api\Setup\Middleware\SetupSmoothyApi::class, \Smoothy\Middleware\CheckSmoothyStatus::class, \Smoothy\Middleware\CheckWebsiteStatus::class, ], ];
API配置
将以下变量添加到.env
中:
CACHE_DRIVER = redis
SMOOTHY_API_ENABLED = true
SMOOTHY_API_CLIENT_ID = ...
SMOOTHY_API_CLIENT_SECRET = ...
SMOOTHY_IMAGE_MANIPULATION_SECRET = ...
SMOOTHY_LICENSE_ID = ...
SMOOTHY_CACHE_HOST = ...
SMOOTHY_CACHE_PASSWORD = ...
将以下代码添加到app/config/cache.php
中:
'stores' => [ 'smoothy_cdn' => [ 'driver' => 'redis', 'connection' => 'smoothy_cdn', ], 'smoothy_access_tokens' => [ 'driver' => 'redis', 'connection' => 'smoothy_access_tokens', ], ],
将以下代码添加到app/config/database.php
中:
'redis' => [ 'smoothy_cdn' => [ 'host' => env('SMOOTHY_CACHE_HOST'), 'password' => env('SMOOTHY_CACHE_PASSWORD'), 'port' => env('SMOOTHY_CACHE_PORT', 6379), 'database' => env('SMOOTHY_CACHE_STORE', 0), ], 'smoothy_access_tokens' => [ 'host' => env('SMOOTHY_CACHE_HOST'), 'password' => env('SMOOTHY_CACHE_PASSWORD'), 'port' => env('SMOOTHY_CACHE_PORT', 6379), 'database' => 2, ], ],
资源
运行php artisan vendor:publish --provider="Smoothy\Providers\SmoothyServiceProvider" --force
。
安装依赖npm install
。
在gulpfile.js
中设置browserSync代理。
执行gulp
。
使用
更新资源
运行php artisan vendor:publish --provider="Smoothy\Providers\SmoothyServiceProvider" --tag=update --force
视图
@extends("smoothy::master")
@section("app_meta")
<!-- meta data -->
@stop
@section("styles")
<!-- additional styles -->
@stop
@section("page")
<!-- content -->
@stop
@section("scripts")
<!-- additional scripts -->
@stop
路由
registerGet(
trans('routes.news').'/{article}',
'news.show',
\App\Http\Controllers\NewsController::class.'@show'
);