Download the PHP package mokhosh/laravel-reporter without Composer

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

Create PDF and Excel reports in Laravel and style them with Tailwind CSS

Latest Version on Packagist Total Downloads

This is basically going to be a wrapper for an Excel generator and a Pdf generator. For the time being these generators are Maatweb and Barry's snappy, that might change in the future.

There is already a package that does this, but I didn't like the API, the coding style and the overall design, with all due respect of course.

Requirements

This package requires PHP 8.

Installation

You can install the package via composer. Make sure to run the Artisan install command to install npm dependencies.

You shouldn't need to do anything else on your client. But on some servers you might need more dependencies. For example on Ubuntu you can run ldd chrome | grep not and it will give you a list of dependencies that Headless Chrome needs to run but you don't have. Then you can install them by running apt install. Here's a guide to help you with that: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

Usage

This is the simplest way to get a PDF. This will report all non-hidden columns:

If you prefer to download the PDF file instead of showing it in the browser you can do this:

You can download the Excel version of your report:

Styles and Transforms

If you don't pass a filter, Reporter will use your database columns to create its table. But if you use a filter, you can use any accessor on your model, and you can filter out some columns like this

That will use a Title Case version of column names for your table headers. If you wish to use custom table headers you can do so like this:

You can also transform the data by passing a closure:

You can add Tailwind CSS classes to your table cells if you want. Cool, right?

You can also mix and match in a million ways: The wholemodelis also passed to thetransform` closure, so you can access other columns if needed:

With this you can even create made-up columns that don't exist on your model and in your database:

Note that because this column does not really exist as a database column or even an accessor on your model, the first argument will be null. That's why I've named it $_.

You can also change the Title of the generated pdf and add metadata

You can decide to show generation date, total pages and page number in footer

You can put your logo in the header

TODO

I'm also thinking of conditional classes that are added to a cell when its content meets a condition passed through a closure that returns a boolean value.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of laravel-reporter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.0
maatwebsite/excel Version ^3.1
nesk/puphpeteer Version ^2.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 mokhosh/laravel-reporter contains the following files

Loading the files please wait ....