added ownership

This commit is contained in:
Denis Duliçi
2021-06-17 10:59:07 +03:00
parent de0d26b803
commit a3572de1ec
54 changed files with 253 additions and 37 deletions

18
app/Traits/Owners.php Normal file
View File

@ -0,0 +1,18 @@
<?php
namespace App\Traits;
trait Owners
{
public function isOwnable()
{
$ownable = $this->ownable ?: true;
return ($ownable === true) && in_array('created_by', $this->getFillable());
}
public function isNotOwnable()
{
return !$this->isOwnable();
}
}