Merge branch '3.x' into shades-registration

This commit is contained in:
Zep Fietje
2023-08-30 09:14:39 +02:00
42 changed files with 233 additions and 116 deletions
@@ -68,7 +68,7 @@ class EntriesDemo extends Component implements HasInfolists
TextEntry::make('apiKey')
->label('API key')
->state('HGA3CH5AB345JD9MQ3')
->hint('[Documentation](/documentation)')
->hint(str('[Documentation](/documentation)')->markdown()->toHtmlString())
->hintColor('primary'),
]),
Group::make()
@@ -80,7 +80,7 @@ class EntriesDemo extends Component implements HasInfolists
TextEntry::make('apiKey')
->label('API key')
->state('HGA3CH5AB345JD9MQ3')
->hint('[Documentation](/documentation)')
->hint(str('[Documentation](/documentation)')->markdown()->toHtmlString())
->hintIcon('heroicon-m-question-mark-circle'),
]),
Group::make()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

@@ -32,11 +32,11 @@ return [
'multiple' => [
'label' => 'Ištrinti pažymėtus',
'label' => 'Ištrinti pasirinktus',
'modal' => [
'heading' => 'Ištrinti pažymėtą :label',
'heading' => 'Ištrinti pasirinktus :label',
'actions' => [
@@ -32,11 +32,11 @@ return [
'multiple' => [
'label' => 'Atskirti pasirinktą',
'label' => 'Atskirti pasirinktus',
'modal' => [
'heading' => 'Atskirti pasirinktą :label',
'heading' => 'Atskirti pasirinktus :label',
'actions' => [
@@ -32,11 +32,11 @@ return [
'multiple' => [
'label' => 'Atsieti pažymėtą',
'label' => 'Atsieti pasirinktus',
'modal' => [
'heading' => 'Atsieti pažymėtą :label',
'heading' => 'Atsieti pasirinktus :label',
'actions' => [
@@ -32,11 +32,11 @@ return [
'multiple' => [
'label' => 'Force delete selected',
'label' => 'Priverstinai ištrinti pasirinktus',
'modal' => [
'heading' => 'Force delete selected :label',
'heading' => 'Priverstinai ištrinti pasirinktus :label',
'actions' => [
+1 -1
View File
@@ -2,7 +2,7 @@
return [
'confirmation' => 'Ar tikrai tai nori atlikti?',
'confirmation' => 'Ar tikrai norite tai atlikti?',
'actions' => [
@@ -8,12 +8,12 @@ return [
'modal' => [
'heading' => 'Arkartoti :label',
'heading' => 'Atkartoti :label',
'actions' => [
'replicate' => [
'label' => 'Arkartoti',
'label' => 'Atkartoti',
],
],
@@ -23,7 +23,7 @@ return [
'notifications' => [
'replicated' => [
'title' => 'Arkartota',
'title' => 'Atkartota',
],
],
@@ -23,7 +23,7 @@ return [
'notifications' => [
'restored' => [
'title' => 'Допис відновлено',
'title' => 'Запис відновлено',
],
],
@@ -51,7 +51,7 @@ return [
'notifications' => [
'restored' => [
'title' => 'Дописи відновлені',
'title' => 'Записи відновлені',
],
],
+2 -1
View File
@@ -474,7 +474,7 @@ TextInput::make('slug')->rules([
function () {
return function (string $attribute, $value, Closure $fail) {
if ($value === 'foo') {
$fail("The {$attribute} is invalid.");
$fail('The :attribute is invalid.');
}
};
},
@@ -494,6 +494,7 @@ TextInput::make('slug')->rules([
}
},
])
```
## Validation attributes
@@ -14,6 +14,10 @@ return [
'label' => 'Pridėti prie :label',
],
'add_between' => [
'label' => 'Pridėti tarp blokų',
],
'delete' => [
'label' => 'Ištrinti',
],
@@ -77,11 +81,11 @@ return [
],
'drag_crop' => [
'label' => 'Drag mode "crop"',
'label' => 'Apkirpti velkant',
],
'drag_move' => [
'label' => 'Drag mode "move"',
'label' => 'Perkelti velkant',
],
'flip_horizontal' => [
@@ -176,7 +180,7 @@ return [
'label' => 'Kraštinių santykiai',
'no_fixed' => [
'label' => 'Free',
'label' => 'Laisvas',
],
],
@@ -197,6 +201,10 @@ return [
'label' => 'Ištrinti eilutę',
],
'reorder' => [
'label' => 'Pastumti',
],
],
'fields' => [
@@ -217,15 +225,18 @@ return [
'toolbar_buttons' => [
'attach_files' => 'Pridėti failus',
'blockquote' => 'Citatos blokas',
'bold' => 'Paryškinta',
'bullet_list' => 'Ženklų sąrašas',
'code_block' => 'Kodo blokas',
'edit' => 'Redaguoti',
'heading' => 'Antraštė',
'italic' => 'Kursyvu',
'link' => 'Nuoroda',
'ordered_list' => 'Sunumeruotas sąrašas',
'preview' => 'Peržiūrėti',
'redo' => 'Perdaryti',
'strike' => 'Perbraukti',
'table' => 'Lentelė',
'undo' => 'Anuliuoti',
],
],
@@ -285,8 +296,8 @@ return [
'link' => [
'actions' => [
'link' => 'Link',
'unlink' => 'Unlink',
'link' => 'Pridėti saitą',
'unlink' => 'Pašalinti saitą',
],
'label' => 'Svetainės adresas',
@@ -311,6 +322,7 @@ return [
'ordered_list' => 'Sunumeruotas sąrašas',
'redo' => 'Perdaryti',
'strike' => 'Perbraukta',
'underline' => 'Pabraukta',
'undo' => 'Anuliuoti',
],
@@ -21,7 +21,10 @@
init: function () {
this.updateVisibleCheckboxListOptions()
this.checkIfAllCheckboxesAreChecked()
$nextTick(() => {
this.checkIfAllCheckboxesAreChecked()
})
Livewire.hook(
'commit',
@@ -23,8 +23,10 @@
:suffix-actions="$suffixActions"
:suffix-icon="$suffixIcon"
:valid="! $errors->has($statePath)"
class="fi-fo-color-picker"
:attributes="\Filament\Support\prepare_inherited_attributes($getExtraAttributeBag())"
:attributes="
\Filament\Support\prepare_inherited_attributes($getExtraAttributeBag())
->class('fi-fo-color-picker')
"
>
<div
x-ignore
@@ -477,6 +477,16 @@ class BaseFileUpload extends Field
return $this->evaluate($this->diskName) ?? config('filament.default_filesystem_disk');
}
public function getMaxFiles(): ?int
{
return $this->evaluate($this->maxFiles);
}
public function getMinFiles(): ?int
{
return $this->evaluate($this->minFiles);
}
public function getMaxSize(): ?int
{
return $this->evaluate($this->maxSize);
@@ -526,11 +536,11 @@ class BaseFileUpload extends Field
'array',
];
if (filled($count = $this->maxFiles)) {
if (filled($count = $this->getMaxFiles())) {
$rules[] = "max:{$count}";
}
if (filled($count = $this->minFiles)) {
if (filled($count = $this->getMinFiles())) {
$rules[] = "min:{$count}";
}
@@ -124,7 +124,7 @@ class CheckboxList extends Field implements Contracts\HasNestedRecursiveValidati
return 'deselectAll';
}
public function relationship(string | Closure | null $name, string | Closure | null $titleAttribute, ?Closure $modifyQueryUsing = null): static
public function relationship(string | Closure | null $name, string | Closure | null $titleAttribute = null, ?Closure $modifyQueryUsing = null): static
{
$this->relationship = $name ?? $this->getName();
$this->relationshipTitleAttribute = $titleAttribute;
@@ -156,12 +156,6 @@ class CheckboxList extends Field implements Contracts\HasNestedRecursiveValidati
]) ?? $relationshipQuery;
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders) && filled($relationshipTitleAttribute)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if ($component->hasOptionLabelFromRecordUsingCallback()) {
return $relationshipQuery
->get()
@@ -171,6 +165,12 @@ class CheckboxList extends Field implements Contracts\HasNestedRecursiveValidati
->toArray();
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if (str_contains($relationshipTitleAttribute, '->')) {
if (! str_contains($relationshipTitleAttribute, ' as ')) {
$relationshipTitleAttribute .= " as {$relationshipTitleAttribute}";
@@ -63,10 +63,6 @@ class Type
]) ?? $query;
}
if (empty($query->getQuery()->orders)) {
$query->orderBy($this->getTitleAttribute());
}
$isFirst = true;
$isForcedCaseInsensitive = $this->isSearchForcedCaseInsensitive($query);
@@ -113,8 +109,14 @@ class Type
->toArray();
}
$titleAttribute = $this->getTitleAttribute();
if (empty($query->getQuery()->orders)) {
$query->orderBy($titleAttribute);
}
return $query
->pluck($this->getTitleAttribute(), $keyName)
->pluck($titleAttribute, $keyName)
->toArray();
});
@@ -131,10 +133,6 @@ class Type
]) ?? $query;
}
if (empty($query->getQuery()->orders)) {
$query->orderBy($this->getTitleAttribute());
}
$keyName = $query->getModel()->getKeyName();
if ($this->hasOptionLabelFromRecordUsingCallback()) {
@@ -146,8 +144,14 @@ class Type
->toArray();
}
$titleAttribute = $this->getTitleAttribute();
if (empty($query->getQuery()->orders)) {
$query->orderBy($titleAttribute);
}
return $query
->pluck($this->getTitleAttribute(), $keyName)
->pluck($titleAttribute, $keyName)
->toArray();
});
+13 -13
View File
@@ -671,7 +671,7 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
return $this->evaluate($this->isSearchable) || $this->isMultiple();
}
public function relationship(string | Closure | null $name, string | Closure | null $titleAttribute, ?Closure $modifyQueryUsing = null): static
public function relationship(string | Closure | null $name, string | Closure | null $titleAttribute = null, ?Closure $modifyQueryUsing = null): static
{
$this->relationship = $name ?? $this->getName();
$this->relationshipTitleAttribute = $titleAttribute;
@@ -703,12 +703,6 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
]) ?? $relationshipQuery;
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders) && filled($relationshipTitleAttribute)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if ($component->isSearchForcedCaseInsensitive($relationshipQuery)) {
$search = Str::lower($search);
}
@@ -741,6 +735,12 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
->toArray();
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if (str_contains($relationshipTitleAttribute, '->')) {
if (! str_contains($relationshipTitleAttribute, ' as ')) {
$relationshipTitleAttribute .= " as {$relationshipTitleAttribute}";
@@ -785,12 +785,6 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
]) ?? $relationshipQuery;
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders) && filled($relationshipTitleAttribute)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if ($relationship instanceof \Znck\Eloquent\Relations\BelongsToThrough) {
$keyName = $relationship->getRelated()->getQualifiedKeyName();
} else {
@@ -806,6 +800,12 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe
->toArray();
}
$relationshipTitleAttribute = $component->getRelationshipTitleAttribute();
if (empty($relationshipQuery->getQuery()->orders)) {
$relationshipQuery->orderBy($relationshipQuery->qualifyColumn($relationshipTitleAttribute));
}
if (str_contains($relationshipTitleAttribute, '->')) {
if (! str_contains($relationshipTitleAttribute, ' as ')) {
$relationshipTitleAttribute .= " as {$relationshipTitleAttribute}";
@@ -170,7 +170,7 @@ use Filament\Infolists\Components\TextEntry;
TextEntry::make('apiKey')
->label('API key')
->hint('[Documentation](/documentation)')
->hint(str('[Documentation](/documentation)')->markdown()->toHtmlString())
->hintColor('primary')
```
@@ -185,7 +185,7 @@ use Filament\Infolists\Components\TextEntry;
TextEntry::make('apiKey')
->label('API key')
->hint('[Documentation](/documentation)')
->hint(str('[Documentation](/documentation)')->markdown()->toHtmlString())
->hintIcon('heroicon-m-question-mark-circle')
```
@@ -200,7 +200,7 @@ use Filament\Infolists\Components\TextEntry;
TextEntry::make('apiKey')
->label('API key')
->hint('[Documentation](/documentation)')
->hint(str('[Documentation](/documentation)')->markdown()->toHtmlString())
->hintIcon('heroicon-m-question-mark-circle', tooltip: 'Read it!')
```
@@ -0,0 +1,9 @@
<?php
return [
'text_entry' => [
'more_list_items' => 'ir dar :count',
],
];
@@ -26,6 +26,8 @@ class DatabaseNotifications extends Component
public static ?string $pollingInterval = '30s';
public static ?string $authGuard = null;
#[On('databaseNotificationsSent')]
public function refresh(): void
{
@@ -115,7 +117,7 @@ class DatabaseNotifications extends Component
public function getUser(): Model | Authenticatable | null
{
return auth()->user();
return auth(static::$authGuard)->user();
}
public function getBroadcastChannel(): ?string
@@ -156,6 +158,11 @@ class DatabaseNotifications extends Component
static::$pollingInterval = $interval;
}
public static function authGuard(?string $guard): void
{
static::$authGuard = $guard;
}
/**
* @return array<string>
*/
@@ -23,6 +23,8 @@ class Notifications extends Component
public static VerticalAlignment $verticalAlignment = VerticalAlignment::Start;
public static ?string $authGuard = null;
public function mount(): void
{
$this->notifications = new Collection();
@@ -82,7 +84,7 @@ class Notifications extends Component
public function getUser(): Model | Authenticatable | null
{
return auth()->user();
return auth(static::$authGuard)->user();
}
public function getBroadcastChannel(): ?string
@@ -112,6 +114,11 @@ class Notifications extends Component
static::$verticalAlignment = $alignment;
}
public static function authGuard(?string $guard): void
{
static::$authGuard = $guard;
}
public function render(): View
{
return view('filament-notifications::notifications');
@@ -0,0 +1,25 @@
<?php
return [
'form' => [
'actions' => [
'save' => [
'label' => 'Salva modifiche',
],
],
],
'notifications' => [
'saved' => [
'title' => 'Salvato',
],
],
];
@@ -13,4 +13,8 @@
{{ $slot }}
</section>
@if (! $this instanceof \Filament\Tables\Contracts\HasTable)
<x-filament-actions::modals />
@endif
</div>
@@ -8,9 +8,7 @@
<li
x-data="{ label: @js($label) }"
data-group-label="{{ $label }}"
@class([
'fi-sidebar-group flex flex-col gap-y-1',
])
class="fi-sidebar-group flex flex-col gap-y-1"
>
@if ($label)
<div
@@ -36,7 +34,7 @@
@endif
<span
class="flex-1 text-sm font-semibold text-gray-700 dark:text-gray-200"
class="fi-sidebar-group-label flex-1 text-sm font-semibold text-gray-700 dark:text-gray-200"
>
{{ $label }}
</span>
@@ -65,22 +63,20 @@
class="fi-sidebar-group-items flex flex-col gap-y-1"
>
@foreach ($items as $item)
@if ($item->isVisible())
<x-filament-panels::sidebar.item
:active-icon="$item->getActiveIcon()"
:active="$item->isActive()"
:badge-color="$item->getBadgeColor()"
:badge="$item->getBadge()"
:first="$loop->first"
:grouped="filled($label)"
:icon="$item->getIcon()"
:last="$loop->last"
:should-open-url-in-new-tab="$item->shouldOpenUrlInNewTab()"
:url="$item->getUrl()"
>
{{ $item->getLabel() }}
</x-filament-panels::sidebar.item>
@endif
<x-filament-panels::sidebar.item
:active-icon="$item->getActiveIcon()"
:active="$item->isActive()"
:badge-color="$item->getBadgeColor()"
:badge="$item->getBadge()"
:first="$loop->first"
:grouped="filled($label)"
:icon="$item->getIcon()"
:last="$loop->last"
:should-open-url-in-new-tab="$item->shouldOpenUrlInNewTab()"
:url="$item->getUrl()"
>
{{ $item->getLabel() }}
</x-filament-panels::sidebar.item>
@endforeach
</ul>
</li>
@@ -14,7 +14,7 @@
<li
@class([
'fi-sidebar-item',
'fi-sidebar-item-active' => $active,
'fi-active fi-sidebar-item-active' => $active,
])
>
<a
@@ -39,10 +39,8 @@
x-tooltip.html="tooltip"
@endif
@class([
'relative flex items-center justify-center gap-x-3 rounded-lg px-2 py-2 text-sm text-gray-700 outline-none transition duration-75 hover:bg-gray-100 focus:bg-gray-100 dark:text-gray-200 dark:hover:bg-white/5 dark:focus:bg-white/5',
'font-semibold' => ! $grouped,
'font-medium' => $grouped,
'bg-gray-100 text-primary-600 dark:bg-white/5 dark:text-primary-400' => $active,
'fi-sidebar-item-button relative flex items-center justify-center gap-x-3 rounded-lg px-2 py-2 text-sm outline-none transition duration-75 hover:bg-gray-100 focus:bg-gray-100 dark:hover:bg-white/5 dark:focus:bg-white/5',
'bg-gray-100 dark:bg-white/5' => $active,
])
>
@if (filled($icon))
@@ -87,7 +85,13 @@
x-transition:enter-start="opacity-0"
x-transition:enter-end="opacity-100"
@endif
class="flex-1 truncate"
@class([
'fi-sidebar-item-label flex-1 truncate',
'text-gray-700 dark:text-gray-200' => ! $active,
'text-primary-600 dark:text-primary-400' => $active,
'font-semibold' => ! $grouped,
'font-medium' => $grouped,
])
>
{{ $slot }}
</span>
@@ -100,6 +100,7 @@ trait HasNavigation
}
return collect($this->getNavigationItems())
->filter(fn (NavigationItem $item): bool => $item->isVisible())
->sortBy(fn (NavigationItem $item): int => $item->getSort())
->groupBy(fn (NavigationItem $item): ?string => $item->getGroup())
->map(function (Collection $items, ?string $groupIndex): NavigationGroup {
@@ -343,6 +343,11 @@ class ListRecords extends Page implements Forms\Contracts\HasForms, Tables\Contr
return [];
}
public function updatedActiveTab(): void
{
$this->resetPage();
}
public function generateTabLabel(string $key): string
{
return (string) str($key)
@@ -390,6 +390,10 @@ abstract class Resource
return static::$globalSearchResultsLimit;
}
public static function modifyGlobalSearchQuery(Builder $query, string $search): void
{
}
public static function getGlobalSearchResults(string $search): Collection
{
$query = static::getGlobalSearchEloquentQuery();
@@ -413,6 +417,8 @@ abstract class Resource
});
}
static::modifyGlobalSearchQuery($query, $search);
return $query
->limit(static::getGlobalSearchResultsLimit())
->get()
+6 -1
View File
@@ -20,7 +20,12 @@ return [
// 'broadcaster' => 'pusher',
// 'key' => env('VITE_PUSHER_APP_KEY'),
// 'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
// 'forceTLS' => true,
// 'wsHost' => env('VITE_PUSHER_HOST'),
// 'wsPort' => env('VITE_PUSHER_PORT'),
// 'wssPort' => env('VITE_PUSHER_PORT'),
// 'authEndpoint' => '/api/v1/broadcasting/auth',
// 'disableStats' => true,
// 'encrypted' => true,
// ],
],
+7 -7
View File
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
<?php
return [
'actions' => [
'close' => [
'label' => 'Chiudi',
],
],
];
@@ -2,7 +2,7 @@
return [
'label' => 'Pagination navigation',
'label' => 'Puslapiavimo navigacija',
'overview' => 'Rodomi nuo :first iki :last rezultatai iš :total',
@@ -10,7 +10,7 @@ return [
'records_per_page' => [
'label' => 'per puslapį',
'label' => 'puslapyje',
'options' => [
'all' => 'Viską',
+4 -4
View File
@@ -11,7 +11,7 @@ return [
'columns' => [
'text' => [
'more_list_items' => 'ir :count daugiau',
'more_list_items' => 'ir dar :count',
],
],
@@ -94,7 +94,7 @@ return [
'heading' => 'Nerasta įrašų',
'description' => 'Sukurk :model, kad pradėti.',
'description' => 'Norėdami pradėti, sukurkite :model.',
],
@@ -131,7 +131,7 @@ return [
'trashed' => [
'label' => 'Ištrinti įrašaų',
'label' => 'Ištrinti įrašai',
'only_trashed' => 'Tik ištrinti įrašai',
@@ -167,7 +167,7 @@ return [
],
'reorder_indicator' => 'Vilk ir paleisk pakeisti įrašų eiliškumui.',
'reorder_indicator' => 'Vilkite ir paleiskite įrašų rikiavimui.',
'selection_indicator' => [
@@ -7,8 +7,9 @@
$canWrap = $canWrap();
$descriptionAbove = $getDescriptionAbove();
$descriptionBelow = $getDescriptionBelow();
$isBadge = $isBadge();
$iconPosition = $getIconPosition();
$isBadge = $isBadge();
$isBulleted = $isBulleted();
$isListWithLineBreaks = $isListWithLineBreaks();
$url = $getUrl();
@@ -56,7 +57,7 @@
<{{ $isListWithLineBreaks ? 'ul' : 'div' }}
@class([
'list-inside list-disc' => $isBulleted(),
'list-inside list-disc' => $isBulleted,
'flex flex-wrap items-center gap-1.5' => $isBadge,
'whitespace-normal' => $canWrap,
])
@@ -95,7 +96,9 @@
"
@endif
@class([
'flex w-max',
'flex' => ! $isBulleted,
'max-w-max' => ! $isBadge,
'w-max' => $isBadge,
'cursor-pointer' => $itemIsCopyable,
])
>
@@ -70,7 +70,7 @@
$hasHeaderToolbar = $isReorderable || count($groups) || $isGlobalSearchVisible || $hasFiltersDropdown || $hasColumnToggleDropdown;
$pluralModelLabel = $getPluralModelLabel();
$records = $isLoaded ? $getRecords() : null;
$allSelectableRecordsCount = $isLoaded ? $getAllSelectableRecordsCount() : null;
$allSelectableRecordsCount = ($isSelectionEnabled && $isLoaded) ? $getAllSelectableRecordsCount() : null;
$columnsCount = count($columns);
$reorderRecordsTriggerAction = $getReorderRecordsTriggerAction($isReordering);
$toggleColumnsTriggerAction = $getToggleColumnsTriggerAction();
@@ -189,10 +189,6 @@ class AssociateAction extends Action
$titleAttribute = $this->getRecordTitleAttribute();
$titleAttribute = filled($titleAttribute) ? $relationshipQuery->qualifyColumn($titleAttribute) : null;
if (empty($relationshipQuery->getQuery()->orders) && filled($titleAttribute)) {
$relationshipQuery->orderBy($titleAttribute);
}
if (filled($search) && ($searchColumns || filled($titleAttribute))) {
$searchColumns ??= [$titleAttribute];
$isFirst = true;
@@ -244,6 +240,10 @@ class AssociateAction extends Action
});
if (filled($titleAttribute)) {
if (empty($relationshipQuery->getQuery()->orders)) {
$relationshipQuery->orderBy($titleAttribute);
}
return $relationshipQuery
->pluck($titleAttribute, $relationship->getModel()->getQualifiedKeyName())
->all();
+4 -4
View File
@@ -225,10 +225,6 @@ class AttachAction extends Action
$titleAttribute = $this->getRecordTitleAttribute();
$titleAttribute = filled($titleAttribute) ? $relationshipQuery->qualifyColumn($titleAttribute) : null;
if (empty($relationshipQuery->getQuery()->orders) && filled($titleAttribute)) {
$relationshipQuery->orderBy($titleAttribute);
}
if (filled($search) && ($searchColumns || filled($titleAttribute))) {
$searchColumns ??= [$titleAttribute];
$isFirst = true;
@@ -272,6 +268,10 @@ class AttachAction extends Action
);
if (filled($titleAttribute)) {
if (empty($relationshipQuery->getQuery()->orders)) {
$relationshipQuery->orderBy($titleAttribute);
}
return $relationshipQuery
->pluck($titleAttribute, $relationship->getQualifiedRelatedKeyName())
->all();