You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To set currently authenticated user as owner for ownable model create - extend it with attribute `withDefaultOwnerOnCreate`. It works for both strict and polymorphic ownership behavior.
250
250
251
251
```php
252
-
use Cog\Contracts\Laravel\Ownership\Ownable as OwnableContract;
252
+
use Cog\Contracts\Ownership\Ownable as OwnableContract;
253
253
use Cog\Laravel\Ownership\Traits\HasOwner;
254
254
use Illuminate\Database\Eloquent\Model;
255
255
@@ -264,7 +264,7 @@ class Article extends Model implements OwnableContract
264
264
To override strategy of getting default owner extend ownable model with `resolveDefaultOwner` method:
265
265
266
266
```php
267
-
use Cog\Contracts\Laravel\Ownership\Ownable as OwnableContract;
267
+
use Cog\Contracts\Ownership\Ownable as OwnableContract;
268
268
use Cog\Laravel\Ownership\Traits\HasOwner;
269
269
use Illuminate\Database\Eloquent\Model;
270
270
@@ -277,7 +277,7 @@ class Article extends Model implements OwnableContract
0 commit comments