Download the PHP package msieprawski/resource-table without Composer

On this page you can find all versions of the php package msieprawski/resource-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 resource-table

Resource Table

About

This Laravel package has been created as a alternative for DataTable. It doesn't use AJAX or any JavaScript. It's very light and scalable. Use it for generating table with data without paying attention to searching/sorting/paginating results. It'll do it for yourself! I'll do my best to develop it all the time because I'll be using it on my projects.

TO DO

Compatibility

Currently package is compatible with Laravel 5

Feature overview

Installation

Add the following to your composer.json file:

Then register this service provider with Laravel:

and add class alias for easy usage

Don't forget to use composer update and composer dump-autoload when is needed!

Usage

All you need to do is creating a ResourceTable with prepared builder object. Then add columns and call make(). That's it!

Examples

Example 1: Simple use

Example 2: Adding columns

Example 3: Joining tables

Example 4: Set custom conditions

Where perPage(20) sets resources per page. Method page(2) sets current page. Method orderBy('id', 'DESC') sets default sorting.

Example 5: Setting up the searchable columns

Let's say your news can be event or hot_topic type.

Example 6: Custom filter logic

Resource Table will generate a thead tag with two rows. First will contain standard th columns but the second one will contain text inputs or select fields (depends on column configuration). Currently Resource Table version supports following column types:

Note

Resource Table will automatically inject All option with _all key to your all select type columns.

Creating pagination presenters

Let's say you don't want to use default built-in Bootstrap 3 pagination HTML structure for your pagination. With ResourceTable you can create your own one or use built-in AdminLTEPresenter. So if you'are using Admin LTE Admin Theme you don't have to worry about pagination HTML! By default ResourceTable use Bootstrap 3 presenter which is default for Laravel 5.

Using Admin LTE pagination presenter

Note

Remember to use full path to class!

Creating your own pagination presenter

You can create your pagination presenter wherever you want but it's recommended to create Presenters directory under your app directory. For this example I created MyCustomPresenter under app/Presenters directory:

All of your custom presenters must extends DefaultPresenter class. Feel free to see how it works (it's strongly based on Laravel's BootstrapThreePresenter). Just copy method which is responsible for element that you want to customize and change it! That's it!

After creating your custom presenter - don't forget to set it in ResourceTable:

Templating

Resource Table allows you to create your own templates! However if you don't need to use own templates, then you are free to use one of the following built-in views:

Using built-in table templates

If you want to use core template just call view() method on your ResourceTable object:

Creating custom table template

Create your own blade view file, name it as you want. For this example I named my file my_table.blade.php under tables directory. Let's say that I need to put custom attribute on each <tr> node in <tbody>:

In every view template you are free to use following variables:

At the end just tell your ResourceTable object to use your custom template:

Auto-generated searchable content for column

Let's say you want to use $column->searchableContent() in your custom template but you want to add custom class for every input or placeholder. It's very easy:

Setting default configuration for each ResourceTable object

If you want to set bootstrap view for each ResourceTable object or you want to set 100 elements per page you can use ResourceTable available static functions:

Translations

ResourceTable has built-in polish and english translations. Please contact me if you've created translations for more languages - I'll be happy to share it with others! If you want to use your own translations or override existing please follow Laravel's instructions available here. Please use resource-table as package name and default.php as translations file.

License

Licensed under the MIT License


All versions of resource-table with dependencies

PHP Build Version
Package Version
No informations.
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 msieprawski/resource-table contains the following files

Loading the files please wait ....