PHPackages                             sammaye/laravel-gridview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sammaye/laravel-gridview

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sammaye/laravel-gridview
========================

Quickly prototype the most used component in web applications: grid views

018PHP

Since Sep 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Sammaye/laravel-gridview)[ Packagist](https://packagist.org/packages/sammaye/laravel-gridview)[ RSS](/packages/sammaye-laravel-gridview/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-gridview
================

[](#laravel-gridview)

An implementation of Yii2's Grid View with such a simple API that it *shouldn't* need explaining.

Even though this can be used in production, it is best used as a placeholder for something better.

Why?
----

[](#why)

Why don't you want super fast prototyping of one the most used components in web applications?

You can literally copy and paste the code for this around and customise it for each record type you have.

What does this offer that others don't?
---------------------------------------

[](#what-does-this-offer-that-others-dont)

Simplicity. This is not a widget, it is simply a helper for `@include`. It provides a set of functions for your chosen views for each part of the grid view.

In fact, it is so simple and free form in its construction that you could manually instantiate each class (including columns) and render them separately in any part of the HTML you like.

What query goes in?
-------------------

[](#what-query-goes-in)

Everything but paginate.

This plugin will not perform filter or search logic for you.

So, as an example (do not actually use this), if your grid was called `user`:

```
$users = User::query()
    ->withTrashed()
    ->where('email', 'like', input('user-email'))
    ->orderBy(
        ltrim(input('user-sort'), '-'),
        strpos(input('user-sort'), '-') === 0 ? 'DESC' : 'ASC'
    )
);
```

This makes it very adaptable to changes and refactoring, such as using vue.js instead.

Dos this need JavaScript?
-------------------------

[](#dos-this-need-javascript)

Nope, that's all upto your own choosing.

Is there an example to get us started?
--------------------------------------

[](#is-there-an-example-to-get-us-started)

Sure, here you go, this goes in a view:

```
{!!
    \sammaye\Grid\Grid::make('user')
        ->setData($users_q)
        ->setDataRowAttributes(function($grid, $row){
            $options = [];
            if ($row->trashed()) {
                $options['class'] = 'table-danger';
            }
            return $options;
        })
        ->setHeaderRowAttributes(['class' => 'thead-dark'])
        ->setColumns([
            \sammaye\Grid\Column::make('id')
                ->setDataCellTag('th')
                ->setLabel(__('#'))
                ->setAttributes(['scope' => 'row']),
            \sammaye\Grid\Column::make('email')
                ->setDataContent(function($column, $row){
                    return $row->email . (
                        $row->hasVerifiedEmail()
                            ? '' . __(
                                'Verified: :date',
                                ['date' => $row->email_verified_at]
                            ) . ''
                            : '' . __('Not Verified') . ''
                    );
                }),
            \sammaye\Grid\Column::make('first_name'),
            \sammaye\Grid\Column::make('last_name'),
            \sammaye\Grid\Column::make('identity_verified')
                ->setDataContent(function($column, $row){
                    if($row->hasVerifiedIdentity()){
                        return '' . __(
                            'Verified: :date',
                            ['date' => $row->identity_verified_at]
                        ) . '';
                    }elseif($row->hasPendingVerifiedIdentity()) {
                        return '' . __(
                            'Pending: :date',
                            ['date' => $row->identity_verification_requested_at]
                        ) . '';
                    }elseif($row->hasRejectedVerifiedIdentity()){
                        return '' . __(
                            'Rejected: :date',
                            ['date' => $row->identity_verification_rejected_at]
                        ) . '';
                    }else{
                        return '' . __('Awaiting') . '';
                    }
                }),
            \sammaye\Grid\Column::make('has_documents')
                ->setDataContent(function($column, $row){
                    return $row->verificationDocuments()->count() > 0
                        ? 'Yes'
                        : 'No';
                }),
            \sammaye\Grid\Column::make('created_at'),
            \sammaye\Grid\Column::make('updated_at'),
            \sammaye\Grid\Column::make('deleted_at'),
            \sammaye\Grid\ActionColumn::make('actions')
                ->setEditButton(function($column, $row){
                    return route('admin.user.edit', ['user' => $row]);
                }, __('Edit'))
                ->setDeleteButton(function($column, $row){
                    return route('admin.user.destroy', ['user' => $row]);
                }, __('Delete'))
                ->setRestoreButton(function($column, $row){
                    return route('admin.user.restore', ['user' => $row]);
                }, __('Restore'))
        ])
    ->getTable()
!!}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7357836d822160350576f98b85244f4d5f960be303a2fcaa15a330187966cbd4?d=identicon)[Sammaye](/maintainers/Sammaye)

---

Top Contributors

[![Sammaye](https://avatars.githubusercontent.com/u/323996?v=4)](https://github.com/Sammaye "Sammaye (9 commits)")

### Embed Badge

![Health badge](/badges/sammaye-laravel-gridview/health.svg)

```
[![Health](https://phpackages.com/badges/sammaye-laravel-gridview/health.svg)](https://phpackages.com/packages/sammaye-laravel-gridview)
```

###  Alternatives

[rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

69810.6M39](/packages/rlanvin-php-rrule)[mixpanel/mixpanel-php

The Official PHP library for Mixpanel

14216.0M24](/packages/mixpanel-mixpanel-php)[skleeschulte/base32

Base32 encoding and decoding class (RFC 4648, RFC 4648 extended hex, Crockford, z-base-32/Zooko).

17314.5k9](/packages/skleeschulte-base32)[chadsikorra/php-simple-enum

Provides a simple enum and flag enum for PHP.

11294.4k1](/packages/chadsikorra-php-simple-enum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
