Looking to hire Laravel developers? Try LaraJobs

laravel-view-sortable maintained by ka4ivan

Description
Sort Link and URL for Laravel Framework
Author
Last update
2025/05/19 19:56 (dev-main)
License
Links
Downloads
480

Comments
comments powered by Disqus

Sort Link and URL for Laravel Framework

License Build Status Latest Stable Version Total Downloads Quality Score

Installation

  1. Require this package with composer
composer require ka4ivan/laravel-view-sortable
  1. Publish package resource:
php artisan vendor:publish --provider="Ka4ivan\ViewSortable\ServiceProvider"

Usage

Examples usage

{!! \Sort::getSortLink('status', 'Status') !!}
// <a class="lte-sort-link" href="http://test.test?sort=status&order=asc" style="position: relative">Status </a>

{!! \Sort::getSortLink(sort: 'city', text: 'City', order: 'desc', class: 'text-black', query: ['locale' => 'uk']) !!}
// <a class="text-black" href="http://test.test?sort=city&order=desc&locale=uk" style="position: relative">City </a>

{!! (new \Ka4ivan\ViewSortable\Support\Sort)->getSortLink('phone', 'Phone') !!}
// <a class="lte-sort-link" href="http://test.test?sort=phone&order=asc" style="position: relative">Phone </a>

{!! \Sort::getSortUrl('status', 'asc') !!}
// http://test.test?sort=status&order=asc

{!! \Sort::getSortUrl('name', 'asc', ['locale' => 'uk']) !!}
// http://test.test?sort=name&order=asc&locale=uk

{!! \Sort::getNextOrder() !!}
// asc|desc