saiashirwadinformatia/secure-ids
Composer 安装命令:
composer require saiashirwadinformatia/secure-ids
包简介
Secure your primary id often used in URL or shared in JSON
README 文档
README
Installation
You can install the package via composer:
composer require saiashirwadinformatia/secure-ids
You can publish the config file with
php artisan vendor:publish --provider="SaiAshirwadInformatia\SecureIds\SecureIdsServiceProvider"
This is the contents of the published config file:
return [
'models_directory' => 'Models',
'model_namespace' => 'App\\Models\\',
'length' => 13,
];
Usage
Load the configs of SecureIds by calling in your AppServiceProvider boot method
use SaiAshirwadInformatia\SecureIds\Facades\SecureIds;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
SecureIds::load();
}
Use trait HasSecureIds for the models you want to enable securing the id.
use SaiAshirwadInformatia\SecureIds\Models\Traits\HasSecureIds;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
// Add below Trait to enable securing id's
use HasSecureIds;
// ...
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 185
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-19