davide-casiraghi/php-responsive-random-quote
Composer 安装命令:
composer require davide-casiraghi/php-responsive-random-quote
包简介
A package that shows responsive random quotes
README 文档
README
Laravel Reponsive Random Quotes
Show a random quote or the quote of the day in your PHP Laravel project.
The package support multi language trough dimsav/laravel-translatable and mcamara/laravel-localization packages.
Installation
Require the package using composer:
composer require davide-casiraghi/php-responsive-random-quote
Publish the files from the service provider
php artisan vendor:publish --force
And then pick the number of the related service provider.
Create the DB tables
php artisan migrate
This will create in your databases two new tables: quotes and quote_translations.
Import the _responsive-quote.scss file in /resources/scss/app.scss
@import 'vendor/responsive-quotes/responsive-quote';
and then run in console:
npm run dev
Usage
Add quotes to the database table
The package adds in the application in which it is installed the route /php-responsive-quote/
From this route it's possible to add, edit and remove the quotes and their translations.
Show a random quote
use DavideCasiraghi\PhpResponsiveRandomQuote\QuoteFactory; $quote = PhpResponsiveQuote::getRandomQuote();
Then in any blade file is possible include the view like this:
@include('vendor.responsive-quotes.show-random-quote', [ 'quoteAuthor' => $quote['author'], 'quoteText' => $quote['text'], ])
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Testing
You can run unit tests checking the code coverage using this command.
./vendor/bin/phpunit --coverage-html=html
So you can find the reports about the code coverage in this file /html/index.html
License
davide-casiraghi/php-responsive-random-quote 适用场景与选型建议
davide-casiraghi/php-responsive-random-quote 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 03 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 davide-casiraghi/php-responsive-random-quote 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 davide-casiraghi/php-responsive-random-quote 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-03-04