27 lines
449 B
PHP
27 lines
449 B
PHP
<?php
|
|
|
|
namespace App\Models\Concerns;
|
|
|
|
trait InteractsWithNova
|
|
{
|
|
/**
|
|
* Check if user can access nova
|
|
*/
|
|
public function canAccessNova(): bool
|
|
{
|
|
if ($this->isMe()) {
|
|
return true;
|
|
}
|
|
|
|
if ($this->hasRole(['admin', 'manager'])) {
|
|
return true;
|
|
}
|
|
|
|
if ($this->hasRole('vendor') && $this->channel()->id) {
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|