php-casbin / laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Apache License 2.0
272 stars 46 forks source link

How to modify the creation time and update time field names #61

Closed Xanyone closed 5 months ago

Xanyone commented 1 year ago

The official document of larravel defines const coverage in the model, but we need to create our own data table, change the creation time and update time fields to createTime and updateTime. Can we add created in the configuration file_ At for repair

leeqvip commented 11 months ago

@Xanyone You can Binding A Singleton for DatabaseAdapter:

$this->app->singleton(DatabaseAdapter::class, function (Application $app) {
    return new DatabaseAdapter($app->make(YourRule::class));
});