Giter Club home page Giter Club logo

Comments (4)

teamupdivision avatar teamupdivision commented on May 24, 2024

Hello,

Thank you for using creative TIM!

You should be able to find what you need in the original code of the template. You can find the pagination that works here --> https://www.creative-tim.com/live/argon-dashboard-pro-laravel

Best.

from ct-argon-dashboard-pro-laravel.

heshamwatany avatar heshamwatany commented on May 24, 2024

The pagination exists in form of HTML not in laravel way of implementation

from ct-argon-dashboard-pro-laravel.

teamupdivision avatar teamupdivision commented on May 24, 2024

Now the project is using the pagination from Datatables Bootstrap5 as you can see in the index.blade.php of category, tag, user, item and role files. To change to Laravel pagination you will need to follows some steps:

  1. In app/Providers/AppServiceProvider.php add at the top of the file
    use Illuminate\Pagination\Paginator;

and in the function boot add this change
public function boot()
{
Paginator::useBootstrap();
}

  1. For your table, go to the controller associated with it, for example if I want to add Laravel pagination to User table you will got to app/Http/Controllers/UserController and in the funtion index I will make the update to
    public function index(User $model)
    {
    $this->authorize('manage-users', User::class);
    return view('laravel.users.index', ['users' => $model->paginate(5)]);
    }

  2. Now you can go to your table in resources/laravel/users/index.blade.php and add after you closing tab for
    {{ $users->links() }}

  3. In the same resources/laravel/users/index.blade.php file, where the @Push('js') takes place you will need to remove the pagination from the Datatable Bootstrap 5 by adding paging: false`` like this

    <script> const dataTableBasic = new simpleDatatables.DataTable("#datatable-basic", { searchable: false, fixedHeight: true, paging: false, columns: [{ select: [2], sortable: false }] }); </script>

    Let us know if that helps.

from ct-argon-dashboard-pro-laravel.

heshamwatany avatar heshamwatany commented on May 24, 2024

It works thanks you very much

from ct-argon-dashboard-pro-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.