@php /** @var string $route */ /** @var \Illuminate\Database\Eloquent\Model $model */ /** @var bool $first */ /** @var bool $last */ /** @var bool $isFirstPage */ /** @var bool $isLastPage */ if (!isset($first) || !is_bool($first)) { throw new \InvalidArgumentException('The $first variable must be set and must be a boolean.'); } if (!isset($last) || !is_bool($last)) { throw new \InvalidArgumentException('The $last variable must be set and must be a boolean.'); } if (!isset($isFirstPage) || !is_bool($isFirstPage)) { throw new \InvalidArgumentException('The $isFirstPage variable must be set and must be a boolean.'); } if (!isset($isLastPage) || !is_bool($isLastPage)) { throw new \InvalidArgumentException('The $isLastPage variable must be set and must be a boolean.'); } // * Route vars $routeName = request()->route()?->getName() ?? 'noroute'; // * Request vars $currentSortCol = session()->get("{$routeName}.sort_col"); $currentSortWay = session()->get("{$routeName}.sort_way"); $searchQuery = request()->input('search'); // * Vue vars $noOrder = $noOrder ?? false; $ignore = isset($ignore) && is_array($ignore) ? $ignore : []; // * Hide order column $sortColIsOrder = $currentSortCol === 'order'; $noOrder = $noOrder || (!$sortColIsOrder && $currentSortCol) || !empty($searchQuery); View::share('noOrder', $noOrder); // * Reset button $hasCustomSort = ($currentSortCol && $currentSortCol !== 'order') || ($currentSortCol === 'order' && $currentSortWay === 'desc'); $showReset = !empty($searchQuery) || $hasCustomSort; $isFirst = $first && $isFirstPage; $isLast = $last && $isLastPage; @endphp @if (!$noOrder)
#{{ $model->order }} @if (isset($selectRoute)) @endif
@csrf @method('PATCH') @if (!$isFirst) @endif @if (!$isLast) @endif
@endif