Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
marco76tv committed Sep 17, 2024
1 parent 8c5d918 commit 9456783
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 78 deletions.
8 changes: 4 additions & 4 deletions Filament/Resources/ScheduleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function getFormSchema(): array
->placeholder(static::trans('messages.custom-command-here'))
->label(static::trans('messages.custom'))
->required()
->visible(fn (Get $get): bool => $get('command') === 'custom' && config('filament-database-schedule.commands.enable_custom')),
->visible(fn (Get $get): bool => 'custom' === $get('command') && config('filament-database-schedule.commands.enable_custom')),
Repeater::make('params')
->schema([
Hidden::make('name'),
Expand Down Expand Up @@ -139,10 +139,10 @@ public static function getFormSchema(): array
*/
TextInput::make('expression')
->placeholder('* * * * *')
->rules([new Corn])
->rules([new Corn()])
->label(static::trans('fields.expression'))
->required()
->helperText(fn (): ?\Illuminate\Support\HtmlString => config('filament-database-schedule.tool-help-cron-expression.enable') ? new HtmlString(" <a href='".config('filament-database-schedule.tool-help-cron-expression.url')."' target='_blank'>".static::trans('messages.help-cron-expression').' </a>') : null),
// ->helperText(fn (): ?\Illuminate\Support\HtmlString => config('filament-database-schedule.tool-help-cron-expression.enable') ? new HtmlString(" <a href='".config('filament-database-schedule.tool-help-cron-expression.url')."' target='_blank'>".static::trans('messages.help-cron-expression').' </a>') : null)
->required(),
TagsInput::make('environments')
->placeholder(null)
->label(static::trans('fields.environments')),
Expand Down
6 changes: 2 additions & 4 deletions Models/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
use Illuminate\Database\Eloquent\Builder;

/**
*
*
* @method static \Modules\Job\Database\Factories\ExportFactory factory($count = null, $state = [])
* @method static Builder|Export newModelQuery()
* @method static Builder|Export newQuery()
* @method static Builder|Export query()
*
* @property int $id
* @property \Illuminate\Support\Carbon|null $completed_at
* @property string $file_disk
Expand All @@ -31,7 +32,6 @@
* @property string|null $created_by
* @property string|null $deleted_at
* @property string|null $deleted_by
*
* @method static Builder|Export whereCompletedAt($value)
* @method static Builder|Export whereCreatedAt($value)
* @method static Builder|Export whereCreatedBy($value)
Expand All @@ -47,10 +47,8 @@
* @method static Builder|Export whereUpdatedAt($value)
* @method static Builder|Export whereUpdatedBy($value)
* @method static Builder|Export whereUserId($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Export extends BaseModel
Expand Down
6 changes: 2 additions & 4 deletions Models/FailedImportRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
use Illuminate\Database\Eloquent\Builder;

/**
*
*
* @method static \Modules\Job\Database\Factories\FailedImportRowFactory factory($count = null, $state = [])
* @method static Builder|FailedImportRow newModelQuery()
* @method static Builder|FailedImportRow newQuery()
* @method static Builder|FailedImportRow query()
*
* @property int $id
* @property array $data
* @property int $import_id
Expand All @@ -24,7 +25,6 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string|null $updated_by
* @property string|null $created_by
*
* @method static Builder|FailedImportRow whereCreatedAt($value)
* @method static Builder|FailedImportRow whereCreatedBy($value)
* @method static Builder|FailedImportRow whereData($value)
Expand All @@ -33,10 +33,8 @@
* @method static Builder|FailedImportRow whereUpdatedAt($value)
* @method static Builder|FailedImportRow whereUpdatedBy($value)
* @method static Builder|FailedImportRow whereValidationError($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class FailedImportRow extends BaseModel
Expand Down
4 changes: 0 additions & 4 deletions Models/FailedJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,22 @@
* @method static Builder|FailedJob newModelQuery()
* @method static Builder|FailedJob newQuery()
* @method static Builder|FailedJob query()
*
* @property int $id
* @property string $uuid
* @property string $connection
* @property string $queue
* @property array $payload
* @property string $exception
* @property string $failed_at
*
* @method static Builder|FailedJob whereConnection($value)
* @method static Builder|FailedJob whereException($value)
* @method static Builder|FailedJob whereFailedAt($value)
* @method static Builder|FailedJob whereId($value)
* @method static Builder|FailedJob wherePayload($value)
* @method static Builder|FailedJob whereQueue($value)
* @method static Builder|FailedJob whereUuid($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class FailedJob extends BaseModel
Expand Down
3 changes: 0 additions & 3 deletions Models/Frequency.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @property Collection<int, \Modules\Job\Models\Parameter> $parameters
* @property int|null $parameters_count
* @property Task|null $task
*
* @method static \Modules\Job\Database\Factories\FrequencyFactory factory($count = null, $state = [])
* @method static Builder|Frequency newModelQuery()
* @method static Builder|Frequency newQuery()
Expand All @@ -38,10 +37,8 @@
* @method static Builder|Frequency whereTaskId($value)
* @method static Builder|Frequency whereUpdatedAt($value)
* @method static Builder|Frequency whereUpdatedBy($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Frequency extends BaseModel
Expand Down
8 changes: 2 additions & 6 deletions Models/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
use Illuminate\Database\Eloquent\Builder;

/**
*
*
* @method static \Modules\Job\Database\Factories\ImportFactory factory($count = null, $state = [])
* @method static Builder|Import newModelQuery()
* @method static Builder|Import newQuery()
* @method static Builder|Import query()
*
* @property int $id
* @property \Illuminate\Support\Carbon|null $completed_at
* @property string $file_name
Expand All @@ -31,7 +32,6 @@
* @property string|null $created_by
* @property string|null $deleted_at
* @property string|null $deleted_by
*
* @method static Builder|Import whereCompletedAt($value)
* @method static Builder|Import whereCreatedAt($value)
* @method static Builder|Import whereCreatedBy($value)
Expand All @@ -47,14 +47,10 @@
* @method static Builder|Import whereUpdatedAt($value)
* @method static Builder|Import whereUpdatedBy($value)
* @method static Builder|Import whereUserId($value)
*
* @property string|null $user_type
*
* @method static Builder|Import whereUserType($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Import extends BaseModel
Expand Down
3 changes: 0 additions & 3 deletions Models/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @property string|null $created_by
* @property string|null $updated_by
* @property Carbon|null $updated_at
*
* @method static \Modules\Job\Database\Factories\JobFactory factory($count = null, $state = [])
* @method static Builder|Job newModelQuery()
* @method static Builder|Job newQuery()
Expand All @@ -43,12 +42,10 @@
* @method static Builder|Job whereReservedAt($value)
* @method static Builder|Job whereUpdatedAt($value)
* @method static Builder|Job whereUpdatedBy($value)
*
* @property mixed $display_name
* @property mixed $status
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Job extends BaseModel
Expand Down
3 changes: 0 additions & 3 deletions Models/JobBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @property Carbon|null $cancelled_at
* @property Carbon $created_at
* @property Carbon|null $finished_at
*
* @method static \Modules\Job\Database\Factories\JobBatchFactory factory($count = null, $state = [])
* @method static Builder|JobBatch newModelQuery()
* @method static Builder|JobBatch newQuery()
Expand All @@ -43,10 +42,8 @@
* @method static Builder|JobBatch whereOptions($value)
* @method static Builder|JobBatch wherePendingJobs($value)
* @method static Builder|JobBatch whereTotalJobs($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class JobBatch extends BaseModel
Expand Down
35 changes: 12 additions & 23 deletions Models/JobManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,25 @@
/**
* Modules\Job\Models\JobManager.
*
* @property \Modules\Xot\Contracts\ProfileContract|null $creator
* @property \Modules\Xot\Contracts\ProfileContract|null $updater
* @property string $id
* @property string $name
* @property bool $failed
* @property int $total_jobs
* @property int $pending_jobs
* @property int $failed_jobs
* @property string $failed_job_ids
* @property Collection|null $options
* @property Carbon|null $cancelled_at
* @property Carbon $created_at
* @property Carbon|null $finished_at
*
* @method static \Modules\Job\Database\Factories\JobManagerFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|JobManager newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|JobManager newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|JobManager query()
*
* @property mixed $status
* @property string $job_id
* @property string|null $name
* @property string|null $queue
* @property \Illuminate\Support\Carbon|null $started_at
* @property \Illuminate\Support\Carbon|null $finished_at
* @property bool $failed
* @property int $attempt
* @property int|null $progress
* @property string|null $exception_message
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
*
* @property-read string $status
* @method static \Modules\Job\Database\Factories\JobManagerFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|JobManager newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|JobManager newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|JobManager query()
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereAttempt($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereExceptionMessage($value)
Expand All @@ -49,10 +42,6 @@
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereQueue($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereStartedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobManager whereUpdatedAt($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class JobManager extends BaseModel
Expand Down Expand Up @@ -101,7 +90,7 @@ public function isFinished(): bool
return true;
}

return $this->finished_at !== null;
return null !== $this->finished_at;
}

public function hasFailed(): bool
Expand Down
3 changes: 0 additions & 3 deletions Models/JobsWaiting.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* @property string|null $updated_by
* @property \Illuminate\Support\Carbon|null $updated_at
* @property mixed $display_name
*
* @method static \Modules\Job\Database\Factories\JobsWaitingFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder|JobsWaiting newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|JobsWaiting newQuery()
Expand All @@ -37,11 +36,9 @@
* @method static \Illuminate\Database\Eloquent\Builder|JobsWaiting whereReservedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobsWaiting whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|JobsWaiting whereUpdatedBy($value)
*
* @property mixed $status
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class JobsWaiting extends Job {}
3 changes: 0 additions & 3 deletions Models/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Frequency|null $task
*
* @method static \Modules\Job\Database\Factories\ParameterFactory factory($count = null, $state = [])
* @method static Builder|Parameter newModelQuery()
* @method static Builder|Parameter newQuery()
Expand All @@ -33,10 +32,8 @@
* @method static Builder|Parameter whereUpdatedAt($value)
* @method static Builder|Parameter whereUpdatedBy($value)
* @method static Builder|Parameter whereValue($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Parameter extends BaseModel
Expand Down
3 changes: 0 additions & 3 deletions Models/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Task|null $task
*
* @method static \Illuminate\Database\Eloquent\Builder|Result newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Result newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Result query()
Expand All @@ -36,10 +35,8 @@
* @method static \Illuminate\Database\Eloquent\Builder|Result whereTaskId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Result whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|Result whereUpdatedBy($value)
*
* @property-read \Modules\Xot\Contracts\ProfileContract|null $creator
* @property-read \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Result extends BaseModel
Expand Down
5 changes: 0 additions & 5 deletions Models/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* @property array $options
* @property \Illuminate\Database\Eloquent\Collection<int, \Modules\Job\Models\ScheduleHistory> $histories
* @property int|null $histories_count
*
* @method static Builder|Schedule active()
* @method static \Modules\Job\Database\Factories\ScheduleFactory factory($count = null, $state = [])
* @method static Builder|Schedule inactive()
Expand All @@ -28,7 +27,6 @@
* @method static Builder|Schedule query()
* @method static Builder|Schedule withTrashed()
* @method static Builder|Schedule withoutTrashed()
*
* @property int $id
* @property string $command
* @property string|null $command_custom
Expand All @@ -54,7 +52,6 @@
* @property string|null $updated_by
* @property string|null $created_by
* @property string|null $deleted_by
*
* @method static Builder|Schedule whereCommand($value)
* @method static Builder|Schedule whereCommandCustom($value)
* @method static Builder|Schedule whereCreatedAt($value)
Expand Down Expand Up @@ -82,10 +79,8 @@
* @method static Builder|Schedule whereWebhookAfter($value)
* @method static Builder|Schedule whereWebhookBefore($value)
* @method static Builder|Schedule whereWithoutOverlapping($value)
*
* @property \Modules\Xot\Contracts\ProfileContract|null $creator
* @property \Modules\Xot\Contracts\ProfileContract|null $updater
*
* @mixin \Eloquent
*/
class Schedule extends BaseModel
Expand Down
Loading

0 comments on commit 9456783

Please sign in to comment.