Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogermani87 authored and github-actions[bot] committed Apr 20, 2024
1 parent 9302895 commit 9a0fc98
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
34 changes: 17 additions & 17 deletions src/Filament/Resources/EmailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static function table(Table $table): Table
->icon('heroicon-o-eye')
->iconSize(IconSize::Medium)
->modalFooterActions(
fn($action): array => [
fn ($action): array => [
$action->getModalCancelAction(),
])
->fillForm(function ($record) {
Expand Down Expand Up @@ -181,21 +181,21 @@ public static function table(Table $table): Table
->nestedRecursiveRules([
'email',
])
->default(fn($record): array => !empty($record->to) ? explode(',', $record->to) : []),
->default(fn ($record): array => ! empty($record->to) ? explode(',', $record->to) : []),
TagsInput::make('cc')
->label(__('filament-email::filament-email.cc'))
->placeholder(__('filament-email::filament-email.insert_multiple_email_placelholder'))
->nestedRecursiveRules([
'email',
])
->default(fn($record): array => !empty($record->cc) ? explode(',', $record->cc) : []),
->default(fn ($record): array => ! empty($record->cc) ? explode(',', $record->cc) : []),
TagsInput::make('bcc')
->label(__('filament-email::filament-email.bcc'))
->placeholder(__('filament-email::filament-email.insert_multiple_email_placelholder'))
->nestedRecursiveRules([
'email',
])
->default(fn($record): array => !empty($record->bcc) ? explode(',', $record->bcc) : []),
->default(fn ($record): array => ! empty($record->bcc) ? explode(',', $record->bcc) : []),
])
->action(function (Email $record, array $data) {
try {
Expand All @@ -221,9 +221,9 @@ public static function table(Table $table): Table
])
->columns([
TextColumn::make('from')
->prefix(__('filament-email::filament-email.from') . ': ')
->prefix(__('filament-email::filament-email.from').': ')
->label(__('filament-email::filament-email.header'))
->description(fn(Email $record): string => Str::limit(__('filament-email::filament-email.to') . ': ' . $record->to, 40))
->description(fn (Email $record): string => Str::limit(__('filament-email::filament-email.to').': '.$record->to, 40))
->searchable(),
TextColumn::make('subject')
->label(__('filament-email::filament-email.subject'))
Expand Down Expand Up @@ -270,16 +270,16 @@ public static function table(Table $table): Table
$indicators = [];
$format = config('filament-email.resource.filter_date_format');

if (!empty($data['created_from'])) {
if (! empty($data['created_from'])) {
$from = Carbon::parse($data['created_from'])->format($format);
$indicators['created'] = __('filament-email::filament-email.from_filter') . " $from";
$indicators['created'] = __('filament-email::filament-email.from_filter')." $from";
}

if (!empty($data['created_until'])) {
if (! empty($data['created_until'])) {
$to = Carbon::parse($data['created_until'])->format($format);
$toText = __('filament-email::filament-email.to_filter');
if (!empty($indicators['created'])) {
$indicators['created'] .= ' ' . strtolower($toText) . " $to";
if (! empty($indicators['created'])) {
$indicators['created'] .= ' '.strtolower($toText)." $to";
} else {
$indicators['created'] = "$toText $to";
}
Expand All @@ -301,23 +301,23 @@ public static function table(Table $table): Table
return $query
->when(
$data['to'],
fn(Builder $query, $value): Builder => $query->where('to', 'like', "%$value%"),
fn (Builder $query, $value): Builder => $query->where('to', 'like', "%$value%"),
)
->when(
$data['cc'],
fn(Builder $query, $value): Builder => $query->where('cc', 'like', "%$value%"),
fn (Builder $query, $value): Builder => $query->where('cc', 'like', "%$value%"),
)
->when(
$data['bcc'],
fn(Builder $query, $value): Builder => $query->where('bcc', 'like', "%$value%"),
fn (Builder $query, $value): Builder => $query->where('bcc', 'like', "%$value%"),
)
->when(
$data['created_from'],
fn(Builder $query, $value): Builder => $query->where('created_at', '>=', $value),
fn (Builder $query, $value): Builder => $query->where('created_at', '>=', $value),
)
->when(
$data['created_until'],
fn(Builder $query, $value): Builder => $query->where('created_at', '<=', $value),
fn (Builder $query, $value): Builder => $query->where('created_at', '<=', $value),
);
}),
]);
Expand All @@ -335,7 +335,7 @@ public static function canAccess(): bool
{
$roles = config('filament-email.can_access.role') ?? [];

if (method_exists(auth()->user(), 'hasRole') && !empty($roles)) {
if (method_exists(auth()->user(), 'hasRole') && ! empty($roles)) {
return auth()->user()->hasRole($roles);
}

Expand Down
6 changes: 3 additions & 3 deletions src/FilamentEmailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace RickDBCN\FilamentEmail;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Config;
use RickDBCN\FilamentEmail\Providers\EmailMessageServiceProvider;
use Spatie\LaravelPackageTools\Package;
use Illuminate\Console\Scheduling\Schedule;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use RickDBCN\FilamentEmail\Providers\EmailMessageServiceProvider;

class FilamentEmailServiceProvider extends PackageServiceProvider
{
Expand Down Expand Up @@ -34,7 +34,7 @@ public function bootingPackage()
$this->callAfterResolving(Schedule::class, function (Schedule $schedule) {
$class = get_class(new (Config::get('filament-email.resource.model')));
if (class_exists($class)) {
$schedule->command('model:prune --model="' . $class . '"')->daily();
$schedule->command('model:prune --model="'.$class.'"')->daily();
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace RickDBCN\FilamentEmail\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Support\Arr;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Config;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Database\Eloquent\Factories\HasFactory;

/**
* Email
Expand Down

0 comments on commit 9a0fc98

Please sign in to comment.