dpsoft / nevise-mehr4
Nevise 对 Mehr LMS 的兼容性
这个软件包的官方仓库似乎已不存在,因此该软件包已被冻结。
v2.3
2020-04-21 05:51 UTC
Requires
- php: ^7.1
- dpsoft/mehr: ^1.1
README
使用这个软件包,您可以将 nevise 迁移到 Mehr4。
安装
您可以通过 composer 安装此软件包
composer require dpsoft/nevise-mehr4
该软件包将自动注册自己。
您可以使用以下命令发布迁移
php artisan vendor:publish --provider="Dpsoft\NeviseMehr4\NeviseMehr4ServiceProvider" --tag="migrations"
您可以选择使用以下命令发布配置文件
php artisan vendor:publish --provider="Dpsoft\NeviseMehr4\NeviseMehr4ServiceProvider" --tag="config"
这是发布配置文件的内容
return [
//nevise files path
'upload_path' => 'public/nevise',
// cache ttl for items like popular tags
'cache_time' => \Carbon\CarbonInterval::hours(12)->totalSeconds,
'post_tag' => [
//post popular tags variable name in balde
'popular_variable_name' => 'postPopularTags',
//post popular tags count
'popular_count' => 5,
],
'categories' => [
//categories variable name in balde
'variable_name' => 'postCategories',
//if 0 then get all categories
'count' => 0,
],
];
用法
外观
此软件包注册了许多路由。要获取此路由,您可以使用 NeviseMehr4
外观
在 nevise 中输入帖子 URL
NeviseMehr4::postUrl($post);
在 nevise 中标记帖子 URL
NeviseMehr4::tagPostsUrl($tag);
在 nevise 中输入作者帖子 URL
NeviseMehr4::authorPostsUrl($user);
在 nevise 中输入类别帖子 URL
NeviseMehr4::categoryPostsUrl($category);
获取所有帖子并分页。默认分页数量为 10。您可以通过传递数字到函数中更改它。
NeviseMehr4::posts();
共享视图
此软件包还在视图中共享了 3 个变量
postPopularTags
用于热门标签,featurePosts
用于特色帖子,postCategories
用于特殊分类。这些名称可以在配置文件中进行配置。
测试
composer test
安全
如果您发现任何与安全相关的问题,请通过电子邮件 sadeghpm@gmail.com 报告,而不是使用问题跟踪器。