@@ -189,11 +189,11 @@ public static function getTitleColumn(): TextColumn
189189 $ currentLang = $ livewire ->lang ;
190190 $ query ->whereHas ('translations ' , function ($ query ) use ($ search , $ currentLang ) {
191191 $ query ->where ('locale ' , $ currentLang )
192- ->where ('title ' , 'like ' , '% ' . $ search . '% ' );
192+ ->where ('title ' , 'like ' , '% ' . $ search. '% ' );
193193 });
194194 })
195195 ->sortable ()
196- ->extraAttributes (fn ($ record ) => [
196+ ->extraAttributes (fn ($ record ) => [
197197 'style ' => $ record ->translations ()->where ('locale ' , request ()->get ('lang ' , app ()->getLocale ()))->withTrashed ()->whereNotNull ('title ' )->exists ()
198198 ? ''
199199 : 'color: var(--gray-500); ' ,
@@ -212,7 +212,7 @@ public static function getTitleColumn(): TextColumn
212212 $ fallbackTranslation = $ record ->translations ()->where ('locale ' , $ defaultLang )->first ();
213213
214214 if ($ fallbackTranslation && $ fallbackTranslation ->title ) {
215- return $ fallbackTranslation ->title . ' ( ' . $ defaultLang . ') ' ;
215+ return $ fallbackTranslation ->title . ' ( ' . $ defaultLang. ') ' ;
216216 }
217217
218218 return 'No title available ' ;
@@ -229,7 +229,7 @@ public static function getSlugColumn(): TextColumn
229229 $ currentLang = request ()->get ('lang ' , $ defaultLang );
230230 $ query ->whereHas ('translations ' , function ($ query ) use ($ search , $ currentLang ) {
231231 $ query ->where ('locale ' , $ currentLang )
232- ->where ('slug ' , 'like ' , '% ' . $ search . '% ' );
232+ ->where ('slug ' , 'like ' , '% ' . $ search. '% ' );
233233 });
234234 })
235235 ->sortable ();
@@ -251,21 +251,21 @@ public static function getTranslationStatusSelect(): Select
251251 public static function getEditableTranslationStatusOptions (): array
252252 {
253253 return collect (TranslationStatus::cases ())
254- ->filter (fn ($ case ) => !in_array ($ case , [TranslationStatus::NOT_TRANSLATED , TranslationStatus::DELETED ]))
255- ->mapWithKeys (fn ($ case ) => [$ case ->value => ucfirst ($ case ->value )])
254+ ->filter (fn ($ case ) => ! in_array ($ case , [TranslationStatus::NOT_TRANSLATED , TranslationStatus::DELETED ]))
255+ ->mapWithKeys (fn ($ case ) => [$ case ->value => ucfirst ($ case ->value )])
256256 ->toArray ();
257257 }
258258
259259 protected static function getCurrentTranslationStatus ($ record ): string
260260 {
261- if (!$ record ) {
261+ if (! $ record ) {
262262 return TranslationStatus::DRAFT ->value ;
263263 }
264264
265265 $ currentLang = request ()->get ('lang ' , app ()->getLocale ());
266266 $ translation = $ record ->translations ()->where ('locale ' , $ currentLang )->first ();
267267
268- if (!$ translation ) {
268+ if (! $ translation ) {
269269 return TranslationStatus::NOT_TRANSLATED ->value ;
270270 }
271271
@@ -287,7 +287,7 @@ protected static function getDefaultStatus(): string
287287 public static function getTranslationStatusOptions (): array
288288 {
289289 return collect (TranslationStatus::cases ())
290- ->mapWithKeys (fn ($ case ) => [$ case ->value => ucfirst ($ case ->value )])
290+ ->mapWithKeys (fn ($ case ) => [$ case ->value => ucfirst ($ case ->value )])
291291 ->toArray ();
292292 }
293293
@@ -310,8 +310,8 @@ public static function getPublishDateField(): DateTimePicker
310310 ->label (__ ('core::core.to_publish_at ' ))
311311 ->placeholder (__ ('core::core.to_publish_at ' ))
312312 ->minDate (now ())
313- ->hidden (fn ($ get ) => $ get ('translation_status ' ) !== 'scheduled ' )
314- ->dehydrateStateUsing (fn ($ state , $ get ) => $ get ('translation_status ' ) === 'scheduled ' ? $ state : null );
313+ ->hidden (fn ($ get ) => $ get ('translation_status ' ) !== 'scheduled ' )
314+ ->dehydrateStateUsing (fn ($ state , $ get ) => $ get ('translation_status ' ) === 'scheduled ' ? $ state : null );
315315 }
316316
317317 /**
@@ -323,8 +323,8 @@ public static function getUnpublishDateField(): DateTimePicker
323323 ->label (__ ('core::core.to_unpublish_at ' ))
324324 ->placeholder (__ ('core::core.to_unpublish_at ' ))
325325 ->minDate (now ())
326- ->hidden (fn ($ get ) => !in_array ($ get ('translation_status ' ), ['scheduled ' , 'published ' ]))
327- ->dehydrateStateUsing (fn ($ state , $ get ) => in_array ($ get ('translation_status ' ), ['scheduled ' , 'published ' ]) ? $ state : null );
326+ ->hidden (fn ($ get ) => ! in_array ($ get ('translation_status ' ), ['scheduled ' , 'published ' ]))
327+ ->dehydrateStateUsing (fn ($ state , $ get ) => in_array ($ get ('translation_status ' ), ['scheduled ' , 'published ' ]) ? $ state : null );
328328 }
329329
330330 /**
@@ -336,19 +336,19 @@ public static function getPublishedAtTextEntry(): TextEntry
336336 ->label (__ ('core::core.published_at ' ))
337337 ->state (function ($ record ): string {
338338 $ translation = $ record ->translations ()->withTrashed ()->first ();
339- if (!$ translation || !$ translation ->published_at ) {
339+ if (! $ translation || ! $ translation ->published_at ) {
340340 return '' ;
341341 }
342342
343343 $ publishedBy = '' ;
344344 if ($ translation ->published_by_id && $ translation ->published_by_type ) {
345345 $ user = app ($ translation ->published_by_type )->find ($ translation ->published_by_id );
346- $ publishedBy = $ user ? ' ' . __ ('core::core.by ' ) . ' ' . $ user ->name : '' ;
346+ $ publishedBy = $ user ? ' ' . __ ('core::core.by ' ). ' ' . $ user ->name : '' ;
347347 }
348348
349- return $ translation ->published_at . ' - ' . $ translation ->published_at ->diffForHumans () . $ publishedBy ;
349+ return $ translation ->published_at . ' - ' . $ translation ->published_at ->diffForHumans (). $ publishedBy ;
350350 })
351- ->hidden (fn ($ record ) => !$ record ->published_at );
351+ ->hidden (fn ($ record ) => ! $ record ->published_at );
352352 }
353353
354354 /**
@@ -358,9 +358,9 @@ public static function getToUnpublishAtTextEntry(): TextEntry
358358 {
359359 return TextEntry::make ('to_unpublish_at ' )
360360 ->label (__ ('core::core.to_unpublish_at ' ))
361- ->state (fn ($ record ): string => $ record ->to_unpublish_at ?
362- $ record ->to_unpublish_at . ' - ' . $ record ->to_unpublish_at ->diffForHumans () : '' )
363- ->hidden (fn ($ record ) => !$ record ->to_unpublish_at );
361+ ->state (fn ($ record ): string => $ record ->to_unpublish_at ?
362+ $ record ->to_unpublish_at . ' - ' . $ record ->to_unpublish_at ->diffForHumans () : '' )
363+ ->hidden (fn ($ record ) => ! $ record ->to_unpublish_at );
364364 }
365365
366366 /**
@@ -389,7 +389,7 @@ function (Builder $query, $value): Builder {
389389 $ defaultLang = $ defaultLocalization ?->locale_variant ?? app ()->getLocale ();
390390 $ currentLang = request ()->query ('lang ' ) ?? request ()->get ('lang ' ) ?? $ defaultLang ;
391391
392- if (!$ value ) {
392+ if (! $ value ) {
393393 return $ query ;
394394 }
395395
@@ -472,7 +472,7 @@ public static function getStatusColumn(): TextColumn
472472
473473 $ translation = $ record ->translations ()->withTrashed ()->where ('locale ' , $ currentLang )->first ();
474474
475- if (!$ translation ) {
475+ if (! $ translation ) {
476476 return TranslationStatus::NOT_TRANSLATED ;
477477 }
478478
0 commit comments