diff --git a/app/Classes/General/Eloquent/Filters/SegmentsIn.php b/app/Classes/General/Eloquent/Filters/SegmentsIn.php new file mode 100644 index 00000000..3f756810 --- /dev/null +++ b/app/Classes/General/Eloquent/Filters/SegmentsIn.php @@ -0,0 +1,21 @@ +whereHas('segments', function ($segment) use ($value) { + $segment->whereIn('id', $value); + }); + } +} diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 7a9cfc00..f295dfd9 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -48,7 +48,8 @@ class CompanyResource extends JsonResource 'currencies' => $this->when($this->business_type === BusinessType::CURRENCY_VENDOR, function(){ $segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first(); return $segment ? CurrencyResource::collection(Currency::whereIn('id', $segment->detail->currencies)->get()) : []; - }) + }), + 'created_at' => $this->created_at->format('d-m-Y') ]; diff --git a/app/Models/Company.php b/app/Models/Company.php index 1922fa10..e2c9dda4 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -35,7 +35,7 @@ class Company extends AbstractModel implements Documentable protected $table = 'companies'; - protected $dates = ['deleted_at']; + protected $dates = ['deleted_at', 'created_at']; /** diff --git a/resources/assets/vue/components/companies/elements/CompanyListComponent.vue b/resources/assets/vue/components/companies/elements/CompanyComponent.vue similarity index 81% rename from resources/assets/vue/components/companies/elements/CompanyListComponent.vue rename to resources/assets/vue/components/companies/elements/CompanyComponent.vue index 5d49b650..c139c2a4 100644 --- a/resources/assets/vue/components/companies/elements/CompanyListComponent.vue +++ b/resources/assets/vue/components/companies/elements/CompanyComponent.vue @@ -1,5 +1,5 @@