Compare commits

...

3 Commits

Author SHA1 Message Date
Shift 921ac28ba7 Apply the Laravel code style 2025-08-29 02:54:54 +00:00
Shift 2b099b3156 Convert string references to ::class
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
2025-08-29 02:54:50 +00:00
Shift ee7668df6f Use Illuminate\Support\Carbon 2025-08-29 02:54:49 +00:00
5 changed files with 9 additions and 10 deletions
+2 -3
View File
@@ -5,9 +5,8 @@ declare(strict_types=1);
namespace App\Rules; namespace App\Rules;
use App\Models\Portfolio; use App\Models\Portfolio;
use App\Models\Transaction;
use Illuminate\Support\Carbon;
use Illuminate\Contracts\Validation\ValidationRule; use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Support\Carbon;
class QuantityValidationRule implements ValidationRule class QuantityValidationRule implements ValidationRule
{ {
@@ -21,7 +20,7 @@ class QuantityValidationRule implements ValidationRule
protected ?string $symbol, protected ?string $symbol,
protected ?string $transactionType, protected ?string $transactionType,
protected string|Carbon|null $date protected string|Carbon|null $date
) { } ) {}
/** /**
* Validate the attribute. * Validate the attribute.
+1 -1
View File
@@ -40,7 +40,7 @@ return [
*/ */
'components' => [ 'components' => [
'spotlight' => [ 'spotlight' => [
'class' => 'App\Support\Spotlight', 'class' => App\Support\Spotlight::class,
], ],
], ],
]; ];
@@ -52,10 +52,10 @@ new class extends Component
{{ Number::currency($holding->dividends_earned ?? 0, $holding->market_data->currency) }} {{ Number::currency($holding->dividends_earned ?? 0, $holding->market_data->currency) }}
</p> </p>
<p class="pt-2 text-sm" title="{{ \Carbon\Carbon::parse($holding->market_data->updated_at)->toIso8601String() }}"> <p class="pt-2 text-sm" title="{{ \Illuminate\Support\Carbon::parse($holding->market_data->updated_at)->toIso8601String() }}">
{{ __('Last Refreshed') }}: {{ __('Last Refreshed') }}:
{{ !is_null($holding->market_data->updated_at) {{ !is_null($holding->market_data->updated_at)
? \Carbon\Carbon::parse($holding->market_data->updated_at)->diffForHumans() ? \Illuminate\Support\Carbon::parse($holding->market_data->updated_at)->diffForHumans()
: '' }} : '' }}
</p> </p>
</div> </div>
@@ -98,6 +98,6 @@ new class extends Component
{{ Number::currency($row->dividends_earned ?? 0, $row->market_data->currency) }} {{ Number::currency($row->dividends_earned ?? 0, $row->market_data->currency) }}
@endscope @endscope
@scope('cell_market_data_updated_at', $row) @scope('cell_market_data_updated_at', $row)
{{ \Carbon\Carbon::parse($row->market_data_updated_at)->diffForHumans() }} {{ \Illuminate\Support\Carbon::parse($row->market_data_updated_at)->diffForHumans() }}
@endscope @endscope
</x-table> </x-table>