Skip to content

Commit

Permalink
Merge branch 'master' of github.com:langleyfoxall/eloquent-report-gen…
Browse files Browse the repository at this point in the history
…erator
  • Loading branch information
DivineOmega committed Jan 22, 2019
2 parents 7aef4bf + 6918f91 commit e0f2228
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Eloquent Report Generator

This package can be used to generates reports from Eloquent models
This package can be used to generate reports from Eloquent models
in many formats, such as CSV, PDF, Markdown, and HTML.

## Installation
Expand All @@ -16,6 +16,24 @@ does not do this for you.

## Usage

First, add the `Reportable` trait to the model or models you wish to
create reports from.

```php
namespace App;

use Illuminate\Database\Eloquent\Model;
use LangleyFoxall\EloquentReportGenerator\Traits\Reportable;

class User extends Model
{
use Reportable;

// ...
```

You can then generate reports elsewhere in your application by calling the static `generateReport` method from this trait.

See the following code snippet for example usage.

```php
Expand Down Expand Up @@ -45,4 +63,4 @@ User::generateReport()
$name->value = ucwords($name);
}
->save(storage_path('app/report.csv'));
```
```

0 comments on commit e0f2228

Please sign in to comment.