Download the PHP package seblhaire/tablebuilder without Composer

On this page you can find all versions of the php package seblhaire/tablebuilder. 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 tablebuilder

TableBuilder

By Sébastien L'haire

A Laravel library to build tables easily, which interacts with a lightweight js builder and builds data from Eloquent Object-Relational Mapping with database tables, or can be used with static data.

It uses:

Data are automatically paginated and can be searched and sorted. You can also easily add other parameters to select data. Demo site available here.

Installation

  1. composer require seblhaire/tablebuilder

  2. Composer will automatically link the package with Laravel. But you still can explicitely add provider and facade to your config/app.php:

  3. Publish package (optionally).

  4. For Javascript and stylesheets, see next section.

Javascript ans stylesheets

On a webpage, every JS library and CSS stylesheets can be linked separately. If you choose this classical way, first dowload and install above mentionned libraries. Then publish package files as explained above and put following tags in your template:

But websites often use many libraries and stylesheets and browser must download many files before the site can be rendered properly. Modern websites come with a single compressed Javascript file which concatenates necessary scripts; same principle for stylesheets. With Laravel you can use Laravel Mix to compile files.

Use NPM package manager : npm install bootstrap jquery moment @fortawesome/fontawesome-free

Then your js source file should be something like this:

For your stylesheet:

Configuration file

Table Builder library is customizable. Default values can be changed, either in configuration file, or by passing options in Facade function (see next section). If you want to modify default configuration file, publish package files and access to config/tablebuilder.php.

Usage

TableBuilder package comes with a simple Facade.

TableBuilderHelper::initTable

Inits a table object that can be passed to the view.

TableBuilderHelper::initTable($objectId, $url, $options)

where:

To summarize, in your controller insert:

Table columns definitions will be explained in following section. In your blade template, insert following at the place you want your table to appear:

{!! $oTable->output() !!}

This instruction inserts all elements necessary to display table. Moreover, actions such as inserting into the database or changing parameters may require refreshing table data; insert $oTable->outputReload() in your functions:

If you need to get your table variable, just use {!! o$Table-> tablevar() !!}.

TableBuilderHelper::initColumn

Inits column objects that can be added to table object.

TableBuilderHelper::initColumn($type, $dataBindTo, $options)

To insert a simple data column, proceed as follows:

$datacolumn = TableBuilderHelper::initColumn('data','titre', ['title' => 'Titre', 'sortable' => true]);

Then it must be attached to table:

$oTable->addColumn($datacolumn);

You can also use this compact syntax:

$oTable->addColumn(TableBuilderHelper::initColumn('data','titre', ['title' => 'Titre', 'sortable' => true]));

Data column (type = 'data')

Data column are default, normal cells to display data. Option list is:

Date column (type = 'date')

Date column are used to display dates. In your database, dates are stored in year-month-day hours:minutes:seconds (hour is in 24 hours format), eg: 2020-11-12 20:24:58. Time can be ommitted. This column simply transforms internal database format into a human-readable format. Date transformaton is based on Moment.js format. Options list is;

Image column (type = 'image')

Image column allows to transform table data into images or font icons. Data can be an URI for images or font classes.

Link column (type = 'link')

Link column transform URL data into clickable links that will be opened in a new tab or window.

Mail column (type = 'mail')

Mail column transform emails data into clickable links that either copy into clipboard or open your mail application.

Numeric (type = 'numeric')

Numeric column format numeric fields into human-readable values.

Status column (type = 'status')

Status column allow to display icons depending of column value.

Checkbox column (type = 'checkbox')

Checkbox columns allow to toggle binary values (on/off, true/false, yes/no etc.). An action can be triggered to modify value.

Action column (type = 'action')

Action column provides a set of action buttons. Action button can be defined globally in column definition or line by line (see next section):

TableBuilderHelper::initDataBuilder

Last Facade function provides a data builder helper, which helps validate post data and builds Eloquent queries to build data displayed in table.

TableBuilderHelper::initDataBuilder($request, $othervalidationrules)

Parameters passed by table are:

Function result is an object of class Seblhaire\TableBuilder\TableDataBuilder.

This object has several methods:

$oTable->addMethodToDisplay('actions', function($user){ $actions = [ ['em' => 'far fa-edit', 'text' => 'Editer utilisateur', 'js' => "loaduser"],*addLine($aLine): adds static data to table.$aLine` must be an array of key-value pairs.

Translation keys

Laravel loads config files very early in process. Therefore config files cannot contain __('translation.key'). In order to solve this issue, we made an helper either to print directly strings or to send translation key to translation helper. Translation keys can be delimited by character # . Ex: "#tablebuilder::messages.required#". Original translations are stored under vendor/seblhaire/tablebuilder/resources/lang. If you publish package files, you can find translations in resources/lang/vendor/tablebuilder/.

Feel free to translate keys in your own language and either to send it to the author or to do a merge request on GitHub.

Questions? Contributions?

Feel free to send feature requests or merge request to the author or simply to ask questions.


All versions of tablebuilder with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/http Version ^11.0
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 seblhaire/tablebuilder contains the following files

Loading the files please wait ....