@@ -129,9 +129,9 @@ public function getAdapter(): KanbanAdapterInterface
129129 * @param array<int, string> $searchable The searchable fields
130130 */
131131 public function mount (
132- KanbanAdapterInterface $ adapter ,
133- ?int $ initialCardsCount = null ,
134- ?int $ cardsIncrement = null ,
132+ KanbanAdapterInterface $ adapter ,
133+ ?int $ initialCardsCount = null ,
134+ ?int $ cardsIncrement = null ,
135135 array $ searchable = []
136136 ): void {
137137 $ this ->adapter = $ adapter ;
@@ -184,7 +184,7 @@ public function mount(
184184 protected function resolveColumnColors (): array
185185 {
186186 $ adapterColors = $ this ->adapter ->getConfig ()->getColumnColors ();
187-
187+
188188 if ($ adapterColors !== null ) {
189189 return $ adapterColors ;
190190 }
@@ -213,7 +213,7 @@ protected function resolveColumnColors(): array
213213
214214 $ colors = [];
215215 $ columnKeys = array_keys ($ this ->adapter ->getConfig ()->getColumnValues ());
216-
216+
217217 foreach ($ columnKeys as $ index => $ key ) {
218218 $ colorIndex = $ index % count ($ defaultColors );
219219 $ colors [$ key ] = $ defaultColors [$ colorIndex ];
@@ -228,7 +228,7 @@ protected function resolveColumnColors(): array
228228 public function createCardForm (Form $ form ): Form
229229 {
230230 $ form = $ this ->adapter ->getCreateForm ($ form , $ this ->activeColumn );
231-
231+
232232 return $ form ->statePath ('cardData ' );
233233 }
234234
@@ -238,7 +238,7 @@ public function createCardForm(Form $form): Form
238238 public function editCardForm (Form $ form ): Form
239239 {
240240 $ form = $ this ->adapter ->getEditForm ($ form );
241-
241+
242242 return $ form ->statePath ('cardData ' );
243243 }
244244
@@ -257,13 +257,13 @@ protected function loadColumnsData(): void
257257 {
258258 foreach ($ this ->columns as $ columnId => $ column ) {
259259 $ limit = $ this ->columnCardLimits [$ columnId ] ?? 10 ;
260-
260+
261261 $ items = $ this ->adapter ->getItemsForColumn ($ columnId , $ limit );
262262 $ this ->columnCards [$ columnId ] = $ this ->formatItems ($ items );
263-
263+
264264 // Ensure that items and total keys exist in columns data
265265 $ this ->columns [$ columnId ]['items ' ] = $ this ->columnCards [$ columnId ];
266-
266+
267267 // Get the total count
268268 $ this ->columns [$ columnId ]['total ' ] = $ this ->adapter ->getColumnItemsCount ($ columnId );
269269 }
@@ -302,9 +302,9 @@ public function loadMoreItems(string $columnId, ?int $count = null): void
302302 $ count = $ count ?? $ this ->cardsIncrement ;
303303 $ currentLimit = $ this ->columnCardLimits [$ columnId ] ?? 10 ;
304304 $ newLimit = $ currentLimit + $ count ;
305-
305+
306306 $ this ->columnCardLimits [$ columnId ] = $ newLimit ;
307-
307+
308308 $ items = $ this ->adapter ->getItemsForColumn ($ columnId , $ newLimit );
309309 $ this ->columnCards [$ columnId ] = $ this ->formatItems ($ items );
310310 }
@@ -330,11 +330,11 @@ protected function formatItems(Collection $items): array
330330 public function reorderCardsInColumn ($ columnId , $ cardIds ): bool
331331 {
332332 $ success = $ this ->adapter ->reorderCardsInColumn ($ columnId , $ cardIds );
333-
333+
334334 if ($ success ) {
335335 $ this ->refreshBoard ();
336336 }
337-
337+
338338 return $ success ;
339339 }
340340
@@ -350,21 +350,21 @@ public function reorderCardsInColumn($columnId, $cardIds): bool
350350 public function moveCardToColumn ($ cardId , $ fromColumn , $ toColumn , $ toColumnCardIds ): bool
351351 {
352352 $ card = $ this ->adapter ->getModelById ($ cardId );
353-
353+
354354 if (!$ card ) {
355355 return false ;
356356 }
357-
357+
358358 $ success = $ this ->adapter ->moveCardToColumn ($ card , $ toColumn );
359-
359+
360360 if ($ success && $ this ->adapter ->getConfig ()->getOrderField () !== null ) {
361361 $ success = $ this ->adapter ->reorderCardsInColumn ($ toColumn , $ toColumnCardIds );
362362 }
363-
363+
364364 if ($ success ) {
365365 $ this ->refreshBoard ();
366366 }
367-
367+
368368 return $ success ;
369369 }
370370
@@ -377,18 +377,18 @@ public function openCreateForm(string $columnId): void
377377 {
378378 $ this ->activeColumn = $ columnId ;
379379 $ this ->resetCreateForm ();
380-
380+
381381 // Pre-set the column field
382382 $ columnField = $ this ->config ['columnField ' ];
383383 $ this ->cardData [$ columnField ] = $ columnId ;
384-
384+
385385 // Apply any order field if needed
386386 $ orderField = $ this ->config ['orderField ' ];
387387 if ($ orderField !== null ) {
388388 $ count = $ this ->getColumnItemsCount ($ columnId );
389389 $ this ->cardData [$ orderField ] = $ count + 1 ;
390390 }
391-
391+
392392 $ this ->isCreateModalOpen = true ;
393393 }
394394
@@ -402,24 +402,24 @@ public function openEditForm(string|int $cardId, string $columnId): void
402402 {
403403 $ this ->activeColumn = $ columnId ;
404404 $ this ->activeCard = $ cardId ;
405-
405+
406406 $ card = $ this ->adapter ->getModelById ($ cardId );
407-
407+
408408 if (!$ card ) {
409409 Notification::make ()
410410 ->title ('Card not found ' )
411411 ->danger ()
412412 ->send ();
413-
413+
414414 return ;
415415 }
416-
416+
417417 $ this ->resetEditForm ();
418-
418+
419419 // Fill form with card data
420420 $ this ->editCardForm ->fill ($ card ->toArray ());
421421 $ this ->cardData = $ card ->toArray ();
422-
422+
423423 $ this ->isEditModalOpen = true ;
424424 }
425425
@@ -429,20 +429,20 @@ public function openEditForm(string|int $cardId, string $columnId): void
429429 public function createCard (): void
430430 {
431431 $ data = $ this ->createCardForm ->getState ();
432-
432+
433433 // Ensure column field is set
434434 $ columnField = $ this ->config ['columnField ' ];
435435 if (!isset ($ data [$ columnField ])) {
436436 $ data [$ columnField ] = $ this ->activeColumn ;
437437 }
438-
438+
439439 $ card = $ this ->adapter ->createCard ($ data );
440-
440+
441441 if ($ card ) {
442442 $ this ->refreshBoard ();
443443 $ this ->resetCreateForm ();
444444 $ this ->isCreateModalOpen = false ;
445-
445+
446446 Notification::make ()
447447 ->title ('Card created ' )
448448 ->success ()
@@ -471,23 +471,23 @@ public function updateCard(): void
471471 {
472472 $ data = $ this ->editCardForm ->getState ();
473473 $ card = $ this ->adapter ->getModelById ($ this ->activeCard );
474-
474+
475475 if (!$ card ) {
476476 Notification::make ()
477477 ->title ('Card not found ' )
478478 ->danger ()
479479 ->send ();
480-
480+
481481 return ;
482482 }
483-
483+
484484 $ success = $ this ->adapter ->updateCard ($ card , $ data );
485-
485+
486486 if ($ success ) {
487487 $ this ->refreshBoard ();
488488 $ this ->resetEditForm ();
489489 $ this ->isEditModalOpen = false ;
490-
490+
491491 Notification::make ()
492492 ->title ('Card updated ' )
493493 ->success ()
@@ -528,22 +528,22 @@ public function confirmDelete(string|int $cardId, string $columnId): void
528528 public function deleteCard (): void
529529 {
530530 $ card = $ this ->adapter ->getModelById ($ this ->activeCard );
531-
531+
532532 if (!$ card ) {
533533 Notification::make ()
534534 ->title ('Card not found ' )
535535 ->danger ()
536536 ->send ();
537-
537+
538538 return ;
539539 }
540-
540+
541541 $ success = $ this ->adapter ->deleteCard ($ card );
542-
542+
543543 if ($ success ) {
544544 $ this ->refreshBoard ();
545545 $ this ->isDeleteConfirmOpen = false ;
546-
546+
547547 Notification::make ()
548548 ->title ('Card deleted ' )
549549 ->success ()
0 commit comments