jsonrai277/laravel-json-placeholder
最新稳定版本:1.0.1
Composer 安装命令:
composer require jsonrai277/laravel-json-placeholder
包简介
A json placeholder integration for laravel
关键字:
README 文档
README
A package that integrates Typicode Json placeholder with laravel. It creates a landing, listing and view pages for all the
available resources posts, comments, albums, photos, todos, users.
Installation
Require the package.
composer require jsonrai277/laravel-json-placeholder
Publish necessary configs and views for customization. It copies the config to config/laravel-json-placeholder in laravel app and also the views to resources/views/vendor/laravel-json-placeholder directory.
php artisan vendor:publish --provider=JsonRai277\\LaravelJsonPlaceholder\\LaravelJsonPlaceholderServiceProvider
Once tag published visit the route /resources. It should render a nice landing page for all the available resources. Also, the config should be pretty self explanatory to override any settings.
Config
Retrieving config.
$config = config('laravel-json-placeholder.pagination_size'); // Returns 10 or whatever set on the config. // Or $config = JsonRai277\LaravelJsonPlaceholder\LaravelJsonPlaceholderConfig::getConfig('pagination_size');
Setting config at rung time.
JsonRai277\LaravelJsonPlaceholder\LaravelJsonPlaceholderConfig::setConfig('pagination_size', 10); // Sets 10.
Testing
You can run tests with:
vendor/bin/phpunit
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-21