PHPackages                             itstructure/laravel-detail-view - 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. [Templating &amp; Views](/categories/templating)
4. /
5. itstructure/laravel-detail-view

ActiveLibrary[Templating &amp; Views](/categories/templating)

itstructure/laravel-detail-view
===============================

Detail view table for laravel framework

1.0.6(1y ago)16.6kMITPHPPHP &gt;=7.1.0

Since Apr 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/itstructure/laravel-detail-view)[ Packagist](https://packagist.org/packages/itstructure/laravel-detail-view)[ RSS](/packages/itstructure-laravel-detail-view/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

Laravel Detail View
===================

[](#laravel-detail-view)

[![Latest Stable Version](https://camo.githubusercontent.com/60a42f6e2b09be8e6bd8759c6bb2ab3e836ca0ba988d4b015cc034a4dd942a56/68747470733a2f2f706f7365722e707567782e6f72672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f762f737461626c65)](https://packagist.org/packages/itstructure/laravel-detail-view)[![Latest Unstable Version](https://camo.githubusercontent.com/6df1550490f692d0e2c203029b5d02f367a53338a1dcc73aad4bfc5ab264abd3/68747470733a2f2f706f7365722e707567782e6f72672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f762f756e737461626c65)](https://packagist.org/packages/itstructure/laravel-detail-view)[![License](https://camo.githubusercontent.com/0515a6eb5ad076549af56a17f574ab9c05019201d302a17bc56adb18795591a2/68747470733a2f2f706f7365722e707567782e6f72672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f6c6963656e7365)](https://packagist.org/packages/itstructure/laravel-detail-view)[![Total Downloads](https://camo.githubusercontent.com/8ef7c30c74fd646ad6f7a6c91b0fae0594e75dc0dfb09fe40378e294a8344f5a/68747470733a2f2f706f7365722e707567782e6f72672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f646f776e6c6f616473)](https://packagist.org/packages/itstructure/laravel-detail-view)[![Build Status](https://camo.githubusercontent.com/7d86c1c386958dd6c143f453e4f62bcf9f3f84fb43d2013b5b25b7c870a87bb2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/itstructure/laravel-detail-view/build-status/main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/551b499658d140b4887bba3d0484fd825443eb0574535aa64148217339f31f86/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f69747374727563747572652f6c61726176656c2d64657461696c2d766965772f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/itstructure/laravel-detail-view/?branch=main)

Introduction
------------

[](#introduction)

This package is to displaying the model data in a Detail table.

[![Detail view appearance](https://github.com/itstructure/laravel-detail-view/raw/main/laravel_detail_view_appearance_en.png)](https://github.com/itstructure/laravel-detail-view/blob/main/laravel_detail_view_appearance_en.png)

Requirements
------------

[](#requirements)

- laravel 5.5+ | 6+ | 7+ | 8+ | 9+ | 10+ | 11+ | 12+
- php &gt;= 7.1
- composer

Installation
------------

[](#installation)

### General from remote packagist repository

[](#general-from-remote-packagist-repository)

Run the composer command:

`composer require itstructure/laravel-detail-view "~1.0.6"`

### If you are testing this package from a local server directory

[](#if-you-are-testing-this-package-from-a-local-server-directory)

In application `composer.json` file set the repository, as in example:

```
"repositories": [
    {
        "type": "path",
        "url": "../laravel-detail-view",
        "options": {
            "symlink": true
        }
    }
],
```

Here,

**../laravel-detail-view** - directory path, which has the same directory level as application and contains Detail View package.

Then run command:

`composer require itstructure/laravel-detail-view:dev-main --prefer-source`

### Publish files (Not necessary)

[](#publish-files-not-necessary)

- To publish views run command:

    `php artisan detail_view:publish --only=views`

    It stores view files to `resources/views/vendor/detail_view` folder.
- To publish translations run command:

    `php artisan detail_view:publish --only=lang`

    It stores translation files to `resources/lang/vendor/detail_view` folder.
- To publish all parts run command without `only` argument:

    `php artisan detail_view:publish`

    Else you can use `--force` argument to rewrite already published files.

Else you can use `--force` argument to rewrite already published file.

Usage
-----

[](#usage)

### View template part

[](#view-template-part)

Use `@detailView()` directive with config array in a blade view template.

#### Simple quick usage

[](#simple-quick-usage)

You can simply set rows to display as **string** format in `rowFields` array.

Note: `$model` must be instance of `Illuminate\Database\Eloquent\Model`.

```
@php
$detailData = [
    'model' => $model,
    'title' => 'Detail table',
    'rowFields' => [
        'id',
        'active',
        'icon',
        'created_at'
    ]
];
@endphp
```

```
@detailView($detailData)
```

Alternative variant without a blade directive:

```
{!! detail_view([
    'model' => $model,
    'title' => 'Detail table',
    'rowFields' => [
        'id',
        'active',
        'icon',
        'created_at'
    ]
]) !!}
```

#### Setting custom options

[](#setting-custom-options)

##### Rows

[](#rows)

Simple example:

```
@detailView([
    'model' => $model,
    'rowFields' => [
        [
            'label' => 'First Name', // Row label.
            'attribute' => 'first_name', // Attribute, by which the row data will be taken from a model.
        ],
        [
            'label' => 'Last Name',
            'value' => function ($model) {
                return $model->last_name;
            }
        ],
    ]
])
```

##### Formatters

[](#formatters)

There are the next formatter keys:

- **html** - is for passing a row content with html tags.
- **image** - is for inserting a row data in to `src` attribute of `` tag.
- **text** - applies `strip_tags()` for a row data.
- **url** - is for inserting a row data in to `href` attribute of `` tag.

For that keys there are the next formatters:

- `HtmlFormatter`
- `ImageFormatter`
- `TextFormatter`
- `UrlFormatter`

Also you can set formatter with some addition options. See the next simple example:

```
@detailView([
    'model' => $model,
    'rowFields' => [
        [
            'attribute' => 'url',
            'format' => [
                'class' => Itstructure\DetailView\Formatters\UrlFormatter::class,
                'title' => 'Source',
                'htmlAttributes' => [
                    'target' => '_blank'
                ]
            ]
        ],
        [
            'attribute' => 'content',
            'format' => 'html'
        ]
    ]
])
```

##### Table heads

[](#table-heads)

To set column titles, you can set `captionColumnConfig` and `valueColumnConfig` as in example:

```
@detailView([
    'model' => $model,
    'captionColumnConfig' => [
        'label' => 'Custom title column',
        'htmlAttributes' => [
            'class' => 'th-title-class'
        ]
    ],
    'valueColumnConfig' => [
        'label' => 'Custom value column',
        'htmlAttributes' => [
            'class' => 'th-value-class'
        ]
    ],
    'rowFields' => [
        [
            'attribute' => 'content',
        ]
    ]
])
```

To hide all table row with head titles:

```
@detailView([
    'model' => $model,
    'showHead' => false,
    'rowFields' => [
        [
            'attribute' => 'content',
        ]
    ]
])
```

##### Complex extended example

[](#complex-extended-example)

```
@php
$detailData = [
    'model' => $model,
    'title' => 'Detail title', // It can be empty ''
    'htmlAttributes' => [
        'class' => 'table table-bordered table-striped'
    ],
    'captionColumnConfig' => [
        'label' => 'Custom title column',
        'htmlAttributes' => [
            'class' => 'th-title-class'
        ]
    ],
    'valueColumnConfig' => [
        'label' => 'Custom value column',
        'htmlAttributes' => [
            'class' => 'th-value-class'
        ]
    ],
    'rowFields' => [
        [
            'attribute' => 'id', // REQUIRED if value is not defined. Attribute name to get row model data.
            'label' => 'ID', // Row label.
            'htmlAttributes' => [
                'class' => 'tr-class'
            ]
        ],
        [
            'label' => 'Active', // Row label.
            'value' => function ($model) { // You can set 'value' as a callback function to get a row data value dynamically.
                return '';
            },
            'format' => 'html', // To render row content without lossless of html tags, set 'html' formatter.
        ],
        [
            'label' => 'Url link', // Row label.
            'attribute' => 'url', // REQUIRED if value is not defined. Attribute name to get row model data.
            'format' => [ // Set special formatter. $model->{$this->attribute} will be inserted in to 'href' attribute of  tag.
                'class' => Itstructure\DetailView\Formatters\UrlFormatter::class, // REQUIRED. For this case it is necessary to set 'class'.
                'title' => 'Source', // title between a tags.
                'htmlAttributes' => [ // Html attributes for  tag.
                    'target' => '_blank'
                ]
            ]
        ],
        [
            'label' => 'Icon', // Row label.
            'value' => function ($model) { // You can set 'value' as a callback function to get a row data value dynamically.
                return $model->icon;
            },
            'format' => [ // Set special formatter. If $model->icon value is a url to image, it will be inserted in to 'src' attribute of  tag.
                'class' => Itstructure\DetailView\Formatters\ImageFormatter::class, // REQUIRED. For this case it is necessary to set 'class'.
                'htmlAttributes' => [ // Html attributes for  tag.
                    'width' => '100'
                ]
            ]
        ],
        'created_at', // Simple row setting by string.
    ]
];
@endphp
```

```
@detailView($detailData)
```

License
-------

[](#license)

Copyright © 2021-2025 Andrey Girnik .

Licensed under the [MIT license](http://opensource.org/licenses/MIT). See LICENSE.txt for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance44

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~234 days

Recently: every ~272 days

Total

7

Last Release

442d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31563329?v=4)[Andrey Girnik](/maintainers/itstructure)[@itstructure](https://github.com/itstructure)

---

Top Contributors

[![itstructure](https://avatars.githubusercontent.com/u/31563329?v=4)](https://github.com/itstructure "itstructure (8 commits)")

---

Tags

detaildetails-viewlaraveltableviewlaravelviewtabledetail detailview

### Embed Badge

![Health badge](/badges/itstructure-laravel-detail-view/health.svg)

```
[![Health](https://phpackages.com/badges/itstructure-laravel-detail-view/health.svg)](https://phpackages.com/packages/itstructure-laravel-detail-view)
```

###  Alternatives

[itstructure/laravel-grid-view

Grid view for laravel framework

2546.6k2](/packages/itstructure-laravel-grid-view)

PHPackages © 2026

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