https://github.com/abdullahghanem/reportable
report system for laravel
https://github.com/abdullahghanem/reportable
Last synced: about 1 month ago
JSON representation
report system for laravel
- Host: GitHub
- URL: https://github.com/abdullahghanem/reportable
- Owner: AbdullahGhanem
- License: mit
- Created: 2015-10-23T04:49:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-24T02:22:39.000Z (over 4 years ago)
- Last Synced: 2025-05-06T06:09:39.465Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 32
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/abdullahghanem/reportable/releases)
[](https://packagist.org/packages/ghanem/reportable)
[](LICENSE)
# Laravel Reportable
This package will allow you to add a full report system into your Laravel application.## Installation
First, pull in the package through Composer.
```js
composer require ghanem/reportable
```And then include the service provider within `app/config/app.php`.
```php
'providers' => [
Ghanem\Reportable\ReportableServiceProvider::class
];
```At last you need to publish and run the migration.
```bash
php artisan vendor:publish --provider="Ghanem\Reportable\ReportableServiceProvider"
```
and
```bash
php artisan migrate
```## Setup a Model
```php
report([
'reason' => str_random(10),
'meta' => ['some more optional data, can be notes or something'],
], $user);
}
```#### Create a conclusion for a Report and add the User Model as "judge" (useful to later see who or what came to this conclusion)
```php
$report->conclude([
'conclusion' => 'Your report was valid. Thanks! We\'ve taken action and removed the entry.',
'action_taken' => 'Record has been deleted.' // This is optional but can be useful to see what happend to the record
'meta' => ['some more optional data, can be notes or something'],
], $user);
```#### Get the conclusion for the Report Model
```php
$report->conclusion;
```#### Get the judge for the Report Model (only available if there is a conclusion)
```php
$report->judge(); // Just a shortcut for $report->conclusion->judge
```#### Get an array with all Judges that have ever "judged" something
```php
Report::allJudges();
```