Skip to content

Commit

Permalink
Merge pull request #95 from shopperlabs/fix-notification-message
Browse files Browse the repository at this point in the history
update notification message when remove product
  • Loading branch information
mckenziearts authored Mar 15, 2022
2 parents 0fd54c0 + 04fae4b commit c529d26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Http/Livewire/Tables/ProductsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Filter;
Expand Down Expand Up @@ -41,7 +42,7 @@ public function delete()
if ($this->selectedRowsQuery->count() > 0) {
(new ProductRepository())->makeModel()->newQuery()->whereIn('id', $this->selectedKeys())->delete();

$this->notification()->success(__('Archived'), __('The orders has successfully archived!'));
$this->notification()->success(__('Removed'), __('The :name has successfully removed!', ['name' => Str::plural('product', $this->selectedRowsQuery->count())]));
}

$this->selected = [];
Expand All @@ -54,7 +55,7 @@ public function deactivate()
if ($this->selectedRowsQuery->count() > 0) {
(new ProductRepository())->makeModel()->newQuery()->whereIn('id', $this->selectedKeys())->update(['is_visible' => false]);

$this->notification()->success(__('Visibility'), __('The products has successfully updated visibility status!'));
$this->notification()->success(__('Visibility'), __('The :name has successfully updated visibility status!', ['name' => Str::plural('product', $this->selectedRowsQuery->count())]));
}

$this->selected = [];
Expand All @@ -67,7 +68,7 @@ public function activate()
if ($this->selectedRowsQuery->count() > 0) {
(new ProductRepository())->makeModel()->newQuery()->whereIn('id', $this->selectedKeys())->update(['is_visible' => true]);

$this->notification()->success(__('Visibility'), __('The products has successfully updated visibility status!'));
$this->notification()->success(__('Visibility'), __('The :name has successfully updated visibility status!', ['name' => Str::plural('product', $this->selectedRowsQuery->count())]));
}

$this->selected = [];
Expand Down Expand Up @@ -112,12 +113,12 @@ public function columns(): array
->sortable()
->searchable()
->format(function ($value) {
return $value ? '<span class="text-gray-500 dark:text-gray-400 font-medium">' . shopper_money_format($value) . '</span>' : null;
return $value ? '<span class="text-secondary-500 dark:text-secondary-400 font-medium">' . shopper_money_format($value) . '</span>' : null;
})->asHtml(),
Column::make('Sku', 'sku')
->sortable()
->format(function ($value) {
return $value ? '<span class="text-gray-500 dark:text-gray-400 font-medium">' . $value . '</span>' : '<span class="inline-flex text-gray-700 dark:text-gray-500">&mdash;</span>';
return $value ? '<span class="text-secondary-500 dark:text-secondary-400 font-medium">' . $value . '</span>' : '<span class="inline-flex text-secondary-700 dark:text-secondary-500">&mdash;</span>';
})->asHtml(),
Column::make('Brand', 'brand')
->format(function ($value) {
Expand All @@ -130,7 +131,7 @@ public function columns(): array
Column::make('Published At', 'published_at')
->sortable()
->format(function ($value) {
return $value ? "<time datetime='" . $value->format('Y-m-d') . "' class='capitalize text-gray-500 dark:text-gray-400'>" . $value->formatLocalized('%d %B, %Y') . '</time>' : '';
return $value ? "<time datetime='" . $value->format('Y-m-d') . "' class='capitalize text-secondary-500 dark:text-secondary-400'>" . $value->formatLocalized('%d %B, %Y') . '</time>' : '';
})->asHtml(),
];
}
Expand Down

0 comments on commit c529d26

Please sign in to comment.