#4348 Heavy Machinery Project- Photograph Module

This commit is contained in:
diashalabi 2021-08-05 13:54:53 +03:00
parent cf6029e453
commit 5544ad5c85
3 changed files with 16 additions and 1 deletions

View File

@ -6,6 +6,7 @@ use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel;
@ -510,4 +511,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
return $this->created_by_id == \auth()->id() || \auth()->user()->isAdmin();
}
public function getCatsIDs()
{
$attr = $this->getAttributes();
return array_filter(
$attr,
function ($key) use ($attr) {
return Str::startsWith($key, 'cat') && $attr[$key];
},
ARRAY_FILTER_USE_KEY
);
}
}

View File

@ -93,4 +93,6 @@ interface AdvInterface extends EntryInterface
public function changeStatus($status);
public function canEdit();
public function getCatsIDs();
}

View File

@ -240,7 +240,7 @@
a {
background-color: unset;
border: 0;
color: #DC3545;
color: #DC3545 !important;
font-family: 'Poppins', sans-serif;
font-weight: 500;
display: inline-flex;