File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
resources/views/includes/columns Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ @aware ([' rowIndex' ] )
2+ <div {!! count ($attributes ) ? $column -> arrayToAttributes ($attributes ) : ' ' ! !} >{{ $rowIndex + 1 } } </div >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rappasoft \LaravelLivewireTables \Views \Columns ;
4+
5+ use Illuminate \Database \Eloquent \Model ;
6+ use Rappasoft \LaravelLivewireTables \Exceptions \DataTableConfigurationException ;
7+ use Rappasoft \LaravelLivewireTables \Views \Column ;
8+
9+ class IncrementColumn extends Column
10+ {
11+
12+ protected string $ view = 'livewire-tables::includes.columns.increment ' ;
13+
14+ public function __construct (string $ title , ?string $ from = null )
15+ {
16+ parent ::__construct ($ title , $ from );
17+ $ this ->label (fn () => null );
18+
19+ }
20+
21+ public function getContents (Model $ row ): null |string |\Illuminate \Support \HtmlString |DataTableConfigurationException |\Illuminate \Contracts \Foundation \Application |\Illuminate \Contracts \View \Factory |\Illuminate \Contracts \View \View
22+ {
23+ return view ($ this ->getView ())
24+ ->withColumn ($ this )
25+ ->withIsTailwind ($ this ->isTailwind ())
26+ ->withIsBootstrap ($ this ->isBootstrap ())
27+ ->withAttributes ($ this ->hasAttributesCallback () ? app ()->call ($ this ->getAttributesCallback (), ['row ' => $ row ]) : []);
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments