huenisys/stir
Composer 安装命令:
composer require huenisys/stir
包简介
starter package for Laravel 5.5
README 文档
README
Bootstrap Laravel 5 with common pages and authentication
Installation
-
add this package:
- $
composer require "huenisys/stir" - $
composer require guzzlehttp/guzzle
- $
-
add app provider:
Stir\StirServiceProvider::class,
-
setup a database: $
art vendor:publish --tag=stir-sqlite -
update /.env to use DB_CONNECTION=sqlite, delete all other DB config entries
-
do a fresh migration with seeds: $
php artisan migrate:refresh --seeder=StirSeeder -
install node deps: $
yarn installafter updating /package.json with below
"devDependencies": {
"axios": "^0.17.1",
"bootstrap": "^4.0.0-beta.2",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.0.1",
"jquery": "^3.1.1",
"laravel-mix": "^1.5.0",
"lodash": "^4.17.4",
"popper.js": "^1.13.0",
"vue": "^2.5.11",
"vuex": "^3.0.1",
"vue-router": "^3.0.1",
"bootstrap-vue": "^1.4.0"
}
- publish assets: $
php artisan vendor:publish --tag=stir-assets - replace favicon.ico, robots.txt with your own in the /resources/stir folder
- update /webpack.mix.js like below
// huenisys/stir mix .autoload({ 'jquery': ['jQuery', '$'], 'popper.js/dist/umd/popper.js': ['Popper'], lodash: ['_'] }) .js(['resources/assets/stir/js/app-stir-guest.js'], './public/js') .js(['resources/assets/stir/js/app-stir-admin.js'], './public/js') .js(['resources/assets/stir/js/app-stir-user.js'], './public/js') .copyDirectory('resources/assets/stir/font-awesome-4.7.0/fonts', 'public/fonts') .copyDirectory('resources/assets/stir/images', 'public/images') .copyDirectory('resources/assets/stir/favicon', 'public/favicon') .sass('resources/assets/stir/sass/app-stir.scss', './public/css') .sass('resources/assets/stir/font-awesome-4.7.0/scss/font-awesome.scss', './public/css') .copy('resources/assets/stir/favicon/favicon.ico', 'public/favicon.ico') .copy('resources/assets/stir/robots.txt', 'public/robots.txt') .copy('resources/assets/stir/.htaccess', 'public/.htaccess') .extract(['jquery','popper.js', 'bootstrap', 'lodash', 'vue', 'vue-router', 'bootstrap-vue']) .sourceMaps() .version();
- update public folder: $
npm run devor $npm run prod - remove Laravel's default root route and replace with Stir::authRoutes();
- install laravel passport
Default users
- user@example.com, welcome1$
- admin@example.com, welcome1$
More info
The service provider replaces the guest middleware with 'guest' => \Stir\Http\Middleware\RedirectIfAuthenticated::class, and adds 'admin' => \Stir\Http\Middleware\IsAdmin::class
Author notes
For local dev, add these entries in composer.json
"repositories": [ {"type": "path", "url": "../packages/stir"} ], "require": { "huenisys/stir": "dev-master", },
ENV
STIR_NTFR_TO=paul+admin@huenits.com
STIR_NTFR_CC=paul+cc@huenits.com
Composer
- $
composer require guzzlehttp/guzzle# SparkPost requirement - $
composer require albertcht/invisible-recaptcha
MySQL
use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }
using Invisible Recaptcha
-
demo: /multirecaptcha
-
add configs:
GRECAPTCHA_KEY=
GRECAPTCHA_SECRET=
- use validation rule like below:
'g-recaptcha-response' => ['required', new \Stir\Rules\Grecaptcha]
- add class grecaptcha-form to form tag
- make sure there's a submit button of type=submit
- add below snippet to page
<!-- add google recaptcha --> @push('scripts') <script type="text/javascript"> var setupGrecaptchaForms = function() { $('.grecaptcha-form').each(function(i, em){ // finds anything with type=submit em.onSubmit = function(token) { $(em).submit(); }; grecaptcha.render($(em).find('[type=submit]')[0], { 'sitekey' : "{{config('stir.gcapkey')}}", 'callback' : em.onSubmit, 'badge': 'inline' }); }) }; </script> <script src='https://www.google.com/recaptcha/api.js?onload=setupGrecaptchaForms&render=explicit' async defer> </script> @endpush @push('styles') <style> /*hides badge*/ .grecaptcha-badge { display:none } </style> @endpush
huenisys/stir 适用场景与选型建议
huenisys/stir 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 69 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 09 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「initialization package」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 huenisys/stir 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 huenisys/stir 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 huenisys/stir 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple ASCII output of array data
Unified environment initialization and diagnostics foundation for all Maatify PHP projects. Provides predictable .env loading, timezone configuration, and Safe Mode protection across local, CI, and production environments — forming the core bootstrap layer for the Maatify ecosystem.
This bundle make an initial setup to a Symfony project
Alfabank REST API integration
laravel package for initialize laravel
统计信息
- 总下载量: 69
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-07