Download the PHP package evgeniy-silantev/laravel-table without Composer

On this page you can find all versions of the php package evgeniy-silantev/laravel-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-table

Generate tables with Laravel

Source Code Latest Version Total Downloads License: MIT Build Status Coverage Status Quality Score

Laravel Table allows you to easily render tables in your views, directly built from PHP code.
This package is shipped with a pre-configuration for Bootstrap 4.* and FontAwesome 5.
However, the templates customization makes it very simple to use with another UI framework.

Compatibility

Laravel version PHP version Package version
^5.5 ^7.1 ^1.0

Usage

Prepare the table configuration somewhere in your code and pass it to the view :

In your view, simply render your table like this :

Table of contents

Installation

Configuration

Publish the package configuration and override the available config values :

Customize translations

To customize the existing translations, publish the packages translations files to make the wanted changes :

Customize templates

Customize the used templates to make this package fit to your needs.
Publish the views with the command :

Table API

:warning: All the following methods are chainable with \Okipa\LaravelTable\Table object except the ->result() methods (returning respectively \Okipa\LaravelTable\Column and \Okipa\LaravelTable\Result objects).

->model()

Set the model used during the table generation.

Notes:

Use case example :

->identifier()

Set the table identifier, in order to automatically generate its id and to customize all the interaction fields in case of multiple tables used on a single view : the interactions with the table like sorting, searching an more will only have an impact on the identified table.

Notes:

Use case example :

->request()

Set the request used for the table generation.

Notes:

Use case example :

->routes()

Set the routes used during the table generation.
The routes declarations will be used for the following features :

  • index (required) : used for the rows number definition, sort and search features.
  • create (optional) : the create button is displayed if this route is declared. The button used this route to redirect to the model creation page.
  • edit (optional) : the edit button is displayed on each row if this route is declared. The route is used to redirect to the model edition page.
  • destroy (optional) : the destroy button is displayed on each row if this route is declared. The route is used to trigger the model destroy action.
  • show (optional) : the show button is displayed on each row if this route is declared. The route is used to redirect to the model show page.

Note :

Use case example :

->rowsNumber

Override the config default number of rows displayed on the table.
The default number of displayed rows is defined in the config('laravel-table.value.rowsNumber') config value.
Set false to display all the models contained in database.

Note :

Use case example :

->rowsNumberSelectionActivation()

Override the default rows number selection activation status.
Calling this method displays a rows number input that enable the user to choose how much rows to show.
The default rows number selection activation status is managed by the config('laravel-table.value.rowsNumberSelectionActivation') value.

Note :`

Use case example :

->query()

Set the query closure that will be executed during the table generation.
For example, you can define your joined tables here.
The closure let you manipulate the following attribute : $query.

Note :

Use case example :

->appends()

Add an array of arguments to append to the paginator and to the following table actions :

  • row number selection
  • searching
  • search canceling
  • sorting.

Note :

Use case example :

->containerClasses()

Override default table container classes.
The default container classes are defined in the config('laravel-table.classes.container') config value.

Note :

Use case example :

->tableClasses()

Override default table classes.
The default table classes are defined in the config('laravel-table.classes.table') config value.

Note :

Use case example :

->trClasses()

Override default table tr classes.
The default tr classes are defined in the config('laravel-table.classes.tr') config value.

Note :

Use case example :

->thClasses()

Override default table tr classes.
The default th classes are defined in the config('laravel-table.classes.th') config value.

Note :

Use case example :

->tdClasses()

Override default table td classes.
The default td classes are defined in the config('laravel-table.classes.td') config value.

Note :

Use case example :

->rowsConditionalClasses()

Set rows classes when the given conditions are respected.
The closure let you manipulate the following attribute : $model. ` Note :

Use case example :

->destroyConfirmationHtmlAttributes()

Define html attributes on the destroy buttons to handle dynamic javascript destroy confirmations.
The closure let you manipulate the following attribute : $model.
Beware : the management of the destroy confirmation is on you, if you do not setup a javascript treatment to ask a confirmation, the destroy action will be directly executed.

Note :

Use case example :

Javascript snippet example :

->disableRows()

Set the disable lines closure that will be executed during the table generation.
The optional second param let you override the classes that will be applied for the disabled lines.
By default, the « config('laravel-table.classes.disabled') » config value is applied.
For example, you can disable the current logged user to prevent him being edited or deleted from the table.
The closure let you manipulate the following attribute : $model.

Note :

Use case example :

->tableTemplate()

Set a custom template path for the table component.
The default table template path is defined in the config('laravel-table.template.table') config value.

Note :

Use case example :

->theadTemplate()

Set a custom template path for the thead component.
The default thead template path is defined in the config('laravel-table.template.thead') config value.

Note :

Use case example :

->tbodyTemplate()

Set a custom template path for the tbody component.
The default tbody template path is defined in the config('laravel-table.template.tbody') config value.

Note :

Use case example :

->resultsTemplate()

Set a custom template path for the results component.
The default results template path is defined in the config('laravel-table.template.results') config value.

Note :

Use case example :

->tfootTemplate()

Set a custom template path for the tfoot component.
The default tfoot template path is defined in the config('laravel-table.template.tfoot') config value.

Note :

Use case example :

->column()

Add a column that will be displayed in the table.
The column key is optional if the column is not declared as sortable or searchable.

Note :

Use case example :

->result()

Add a result row that will be displayed at the bottom of the table.

Note :

Use case example :

Column API

:warning: All the column methods are chainable with \Okipa\LaravelTable\Column object.

->classes()

Set the custom classes that will be applied on this column only.

Note :

Use case example :

->title()

Set the column title or override the default (__('validation.attributes.[column key])) title generated from the column name.

Note :

Use case example :

->sortable()

Make the column sortable.
You also can choose to set the column sorted by default.
If no column is sorted by default, the first one will be automatically sorted.

Note :

Use case example :

->searchable()

Make the column searchable.
The first param allows you to precise the searched database table (can references a database table alias).
The second param allows you to precise the searched database attributes (if not precised, the table database column is searched).

Note :

Use case example :

->dateTimeFormat()

Set the format for a datetime, date or time database column (optional).
(Carbon::parse($value)->format($format) method is used under the hood).

Note :

Use case example :

->button()

Display the column as a button with the given classes.

Note :

Use case example :

Wrap the column value into a <a></a> component.
You can declare the link as a string or as a closure which will let you manipulate the following attributes : $model, $column.
If no url is declared, it will be set with the column value.

Note :

Use case example :

->icon()

Add an icon before the displayed value.
Set the second param as true if you want the icon to be displayed even if the column has no value.

Note :

Use case example :

->stringLimit()

Set the string value display limitation.
Shows "..." when the limit is reached.

Note :

Use case example :

->value()

Display a custom value for the column.
The closure let you manipulate the following attributes : $model, $column.

Note :

Use case example :

->html()

Display a custom HTML for the column.
The closure let you manipulate the following attributes : $model, $column.

Note :

Use case example :

Result API

:warning: All the result methods are chainable with \Okipa\LaravelTable\Result object.

->title()

Set the result row title.

Note :

Use case example :

->html()

Display a HTML output for the result row.
The closure let you manipulate the following attributes : $displayedList.

Note :

Use case example :

->classes()

Override the default results classes and apply the given classes only on this result row.
The default result classes are managed by the config('laravel-table.classes.results') value.

Note :

Use case example :

Tips

Usage examples

Basic

In your controller, simply call the package like the following example to generate your table :

Then, send your $table object in your view and render your table like this :

That's it !

Advanced

If you need your table for a more advanced usage, with a multilingual project for example, here is an example of what you can do in your controller :

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-table with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-pdo Version *
illuminate/support Version ~5.5.0||~5.6.0||~5.7.0||~5.8.0||~6.0||^7.2
okipa/laravel-html-helper Version ^1.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package evgeniy-silantev/laravel-table contains the following files

Loading the files please wait ....