moezmissaoui/quotes
最新稳定版本:v0.0.1-alpha
Composer 安装命令:
composer require moezmissaoui/quotes
包简介
Quotes is a simple package to generate a random quotes
README 文档
README
This is a simple laravel package. It can be an exemple to learn how to create laravel package. This package called quotes. If someone installs this in their Laravel project, they'll receive a random inspirational quote upon visiting the /quote/{mode?} route. You'll get the quotes from the zenquotes.io/api/random API.
Installation
Execute the following command to install the package:
composer require MoezMissaoui/quotes
How to use
{base_url}/quote/{mode?}
There is 3 modes:
- quotes : Generate a JSON array of 50 random quotes on each request.
- today : Generate the quote of the day on each request.
- random : Generate a random quote on each request.
- by default (/quote) [mode param is not required] : It will be random mode.
Conclusion
I would like to thank you for trying my implementation for this simple package. I hope you've enjoyed it and have learned some useful stuff regarding Laravel custom package development. Although in real life, packages can be much more complicated than this, the ideas should be more or less the same. If you’re stuck somewhere, feel free to reach out on LinkedIn.
About
Requirements
- PHP 7.* or newer
- guzzlehttp/guzzle ^7.5
License
MIT
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-25