@@ -88,13 +88,13 @@ public static function form(Schema $schema): Schema
8888 relationship: 'parent ' ,
8989 titleAttribute: 'title ' ,
9090 parentAttribute: 'parent_id ' ,
91- modifyQueryUsing: fn (Builder $ query , $ get ) => $ query ->where ('id ' , '!= ' , $ get ('id ' ))
91+ modifyQueryUsing: fn (Builder $ query , $ get ) => $ query ->where ('id ' , '!= ' , $ get ('id ' ))
9292 )
9393 ->label ('Parent Category ' )
9494 ->searchable ()
95- ->disabledOptions (fn ($ get ): array => [$ get ('id ' )])
95+ ->disabledOptions (fn ($ get ): array => [$ get ('id ' )])
9696 ->enableBranchNode ()
97- ->visible (fn () => Category::count () > 0 ),
97+ ->visible (fn () => Category::count () > 0 ),
9898 ])
9999 ->columnSpan (2 ),
100100 Grid::make ()
@@ -109,16 +109,16 @@ public static function form(Schema $schema): Schema
109109 TextInput::make ('weight ' )->numeric (),
110110 TextInput::make ('count ' )
111111 ->disabled ()
112- ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
112+ ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
113113 DateTimePicker::make ('created_at ' )
114114 ->disabled ()
115- ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
115+ ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
116116 DateTimePicker::make ('updated_at ' )
117117 ->disabled ()
118- ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
118+ ->visible (fn ($ livewire , $ record ): bool => ($ record && $ livewire instanceof EditCategory) || ($ record && $ livewire instanceof ViewCategory)),
119119 DateTimePicker::make ('deleted_at ' )
120120 ->disabled ()
121- ->visible (fn ($ livewire , $ record ): bool => $ record && $ record ->trashed () && $ livewire instanceof ViewCategory),
121+ ->visible (fn ($ livewire , $ record ): bool => $ record && $ record ->trashed () && $ livewire instanceof ViewCategory),
122122 ]),
123123 ])
124124 ->columnSpan (1 )
@@ -135,7 +135,7 @@ public static function table(Table $table): Table
135135 $ currentTab = static ::getCurrentTab ();
136136
137137 return $ table
138- ->query (fn (): Builder => static ::getEloquentQuery ())
138+ ->query (fn (): Builder => static ::getEloquentQuery ())
139139 ->defaultSort ('_lft ' , 'asc ' )
140140 ->columns ([
141141 TextColumn::make ('id ' )->sortable (),
@@ -172,7 +172,7 @@ public static function table(Table $table): Table
172172 }),
173173 TextColumn::make ('level ' )
174174 ->label (__ ('category::fields.level ' ))
175- ->getStateUsing (fn (Category $ record ): int => $ record ->ancestors ->count () + 1 )
175+ ->getStateUsing (fn (Category $ record ): int => $ record ->ancestors ->count () + 1 )
176176 ->sortable ()
177177 ->toggleable (isToggledHiddenByDefault: true ),
178178 TextColumn::make ('children_count ' )
@@ -214,16 +214,16 @@ public static function table(Table $table): Table
214214 ->defaultSort ('updated_at ' , 'desc ' )
215215 ->recordActions ([
216216 ViewAction::make (),
217- EditAction::make ()->hidden (fn (): bool => in_array (static ::getCurrentTab (), ['trash ' , 'deleted ' ])),
217+ EditAction::make ()->hidden (fn (): bool => in_array (static ::getCurrentTab (), ['trash ' , 'deleted ' ])),
218218 ])
219219 ->toolbarActions ([
220- DeleteBulkAction::make ()->hidden (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
221- RestoreBulkAction::make ()->visible (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
220+ DeleteBulkAction::make ()->hidden (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
221+ RestoreBulkAction::make ()->visible (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
222222 ])
223223 ->filters ([
224224 SelectFilter::make ('parent_id ' )
225225 ->label (__ ('category::fields.parent ' ))
226- ->relationship ('parent ' , 'title ' , fn ($ query ) => $ query ->has ('children ' ))
226+ ->relationship ('parent ' , 'title ' , fn ($ query ) => $ query ->has ('children ' ))
227227 ->searchable (),
228228 SelectFilter::make ('children_count ' )
229229 ->label (__ ('category::fields.children_count ' ))
@@ -233,7 +233,7 @@ public static function table(Table $table): Table
233233 '6-10 ' => '6-10 ' ,
234234 '10+ ' => '10+ ' ,
235235 ])
236- ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ option ) {
236+ ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ option ) {
237237 switch ($ option ) {
238238 case '0 ' :
239239 return $ query ->doesntHave ('children ' );
@@ -247,8 +247,8 @@ public static function table(Table $table): Table
247247 })),
248248 SelectFilter::make ('depth ' )
249249 ->label (__ ('category::fields.level ' ))
250- ->options (fn (): array => array_combine (range (1 , 5 ), range (1 , 5 )))
251- ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ depth ): void {
250+ ->options (fn (): array => array_combine (range (1 , 5 ), range (1 , 5 )))
251+ ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ depth ): void {
252252 $ query ->whereIn ('id ' , function ($ subquery ) use ($ depth ): void {
253253 $ subquery ->select ('id ' )
254254 ->from ('categories as c ' )
@@ -259,16 +259,16 @@ public static function table(Table $table): Table
259259 ->defaultSort ('id ' , 'asc ' )
260260 ->recordActions ([
261261 ViewAction::make (),
262- EditAction::make ()->hidden (fn (): bool => in_array (static ::getCurrentTab (), ['trash ' , 'deleted ' ])),
262+ EditAction::make ()->hidden (fn (): bool => in_array (static ::getCurrentTab (), ['trash ' , 'deleted ' ])),
263263 ])
264264 ->toolbarActions ([
265- DeleteBulkAction::make ()->hidden (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
266- RestoreBulkAction::make ()->visible (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
265+ DeleteBulkAction::make ()->hidden (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
266+ RestoreBulkAction::make ()->visible (fn (): bool => in_array ($ currentTab , ['trash ' , 'deleted ' ])),
267267 ])
268268 ->filters ([
269269 SelectFilter::make ('parent_id ' )
270270 ->label (__ ('category::fields.parent ' ))
271- ->relationship ('parent ' , 'title ' , fn ($ query ) => $ query ->has ('children ' ))
271+ ->relationship ('parent ' , 'title ' , fn ($ query ) => $ query ->has ('children ' ))
272272 ->searchable (),
273273 SelectFilter::make ('children_count ' )
274274 ->label (__ ('category::fields.children_count ' ))
@@ -278,7 +278,7 @@ public static function table(Table $table): Table
278278 '6-10 ' => '6-10 ' ,
279279 '10+ ' => '10+ ' ,
280280 ])
281- ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ option ) {
281+ ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ option ) {
282282 switch ($ option ) {
283283 case '0 ' :
284284 return $ query ->doesntHave ('children ' );
@@ -292,8 +292,8 @@ public static function table(Table $table): Table
292292 })),
293293 SelectFilter::make ('depth ' )
294294 ->label (__ ('category::fields.level ' ))
295- ->options (fn (): array => array_combine (range (1 , 5 ), range (1 , 5 )))
296- ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ depth ): void {
295+ ->options (fn (): array => array_combine (range (1 , 5 ), range (1 , 5 )))
296+ ->query (fn (Builder $ query , array $ data ) => $ query ->when ($ data ['value ' ], function ($ query , $ depth ): void {
297297 $ query ->whereIn ('id ' , function ($ subquery ) use ($ depth ): void {
298298 $ subquery ->select ('id ' )
299299 ->from ('categories as c ' )
0 commit comments