Skip to content

Commit

Permalink
Updated namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp committed Apr 2, 2019
1 parent c2a388e commit 8390d0e
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 44 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Laravel Reportable
# Laravel Report 📢

[![Build Status](https://img.shields.io/travis/faustbrian/Laravel-Reportable/master.svg?style=flat-square)](https://travis-ci.org/faustbrian/Laravel-Reportable)
[![PHP from Packagist](https://img.shields.io/packagist/php-v/faustbrian/laravel-reportable.svg?style=flat-square)]()
[![Latest Version](https://img.shields.io/github/release/faustbrian/Laravel-Reportable.svg?style=flat-square)](https://github.com/faustbrian/Laravel-Reportable/releases)
[![License](https://img.shields.io/packagist/l/faustbrian/Laravel-Reportable.svg?style=flat-square)](https://packagist.org/packages/faustbrian/Laravel-Reportable)
[![Build Status](https://img.shields.io/travis/pmochine/Laravel-Report/master.svg?style=flat-square)](https://travis-ci.org/pmochine/Laravel-Report)
[![PHP from Packagist](https://img.shields.io/packagist/php-v/pmochine/laravel-report.svg?style=flat-square)]()
[![Latest Version](https://img.shields.io/github/release/pmochine/Laravel-Report.svg?style=flat-square)](https://github.com/pmochine/Laravel-Report/releases)
[![License](https://img.shields.io/packagist/l/pmochine/Laravel-Report.svg?style=flat-square)](https://packagist.org/packages/pmochine/Laravel-Report)

## Installation

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

``` bash
$ composer require faustbrian/laravel-reportable
$ composer require pmochine/laravel-report
```

To get started, you'll need to publish the vendor assets and migrate:

```
php artisan vendor:publish --provider="BrianFaust\Reportable\ReportableServiceProvider" && php artisan migrate
php artisan vendor:publish --provider="Pmochine\Report\ReportServiceProvider" && php artisan migrate
```

## Usage
Expand All @@ -27,7 +27,7 @@ php artisan vendor:publish --provider="BrianFaust\Reportable\ReportableServicePr

namespace App;

use BrianFaust\Reportable\HasReports;
use Pmochine\Report\HasReports;
use Illuminate\Database\Eloquent\Model;

class Post extends Model
Expand Down Expand Up @@ -78,10 +78,13 @@ $ phpunit

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.
If you discover any security related issues, please don't email me. I'm afraid 😱. [email protected]

## Credits

Now comes the best part! 😍
This package is based on

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

Expand Down
19 changes: 12 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "faustbrian/laravel-reportable",
"description": "reportable Polymorphic Eloquent Models for Laravel 5",
"keywords": ["laravel", "framework", "Laravel-reportable", "Laravel Reportable", "Brian Faust", "faustbrian"],
"name": "pmochine/laravel-report",
"description": "Reportable Polymorphic Eloquent Models for Laravel 5",
"keywords": ["laravel", "report", "Laravel-reportable", "Laravel Reportable", "Laravel-report", "Laravel Report", "feedback"],
"license": "MIT",
"authors": [{
"name": "Brian Faust",
"email": "[email protected]",
"homepage": "https://brianfaust.me"
}],
},
{
"name": "Philipp Mochine",
"email": "[email protected]"
}
],
"require": {
"php": ">=7.1",
"illuminate/support": "~5.4||~5.5||~5.6||~5.7||~5.8",
Expand All @@ -20,12 +25,12 @@
},
"autoload": {
"psr-4": {
"BrianFaust\\Reportable\\": "src/"
"Pmochine\\Report\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"BrianFaust\\Tests\\Reportable\\": "tests"
"Pmochine\\Tests\\Report\\": "tests"
}
},
"config": {
Expand All @@ -38,7 +43,7 @@
},
"laravel": {
"providers": [
"BrianFaust\\Reportable\\ReportableServiceProvider"
"Pmochine\\Report\\ReportServiceProvider"
]
}
},
Expand Down
2 changes: 0 additions & 2 deletions database/migrations/create_reports_table.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand Down
4 changes: 1 addition & 3 deletions src/Models/Conclusion.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Reportable\Models;
namespace Pmochine\Report\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
Expand Down
6 changes: 2 additions & 4 deletions src/Models/Report.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Reportable\Models;
namespace Pmochine\Report\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
Expand Down Expand Up @@ -41,7 +39,7 @@ public function judge(): Model
public function conclude($data, Model $judge): Conclusion
{
$conclusion = (new Conclusion())->fill(array_merge($data, [
'judge_id' => $judge->id,
'judge_id' => $judge->id,
'judge_type' => get_class($judge),
]));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,19 +9,19 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Reportable;
namespace Pmochine\Report;

use Illuminate\Support\ServiceProvider;

class ReportableServiceProvider extends ServiceProvider
class ReportServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot()
{
$this->publishes([
__DIR__.'/../database/migrations' => database_path('migrations'),
__DIR__ . '/../database/migrations' => database_path('migrations'),
], 'migrations');
}
}
12 changes: 5 additions & 7 deletions src/Traits/HasReports.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,9 +9,9 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Reportable\Traits;
namespace Pmochine\Report\Traits;

use BrianFaust\Reportable\Models\Report;
use Pmochine\Report\Models\Report;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphMany;

Expand All @@ -24,11 +22,11 @@ public function reports(): MorphMany
return $this->morphMany(Report::class, 'reportable');
}

public function report($data, Model $reportable): Report
public function report($data, Model $reporter): Report
{
$report = (new Report())->fill(array_merge($data, [
'reporter_id' => $reportable->id,
'reporter_type' => get_class($reportable),
'reporter_id' => $reporter->id,
'reporter_type' => get_class($reporter),
]));

$this->reports()->save($report);
Expand Down
6 changes: 2 additions & 4 deletions tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Tests\Reportable;
namespace Pmochine\Tests\Report;

use GrahamCampbell\TestBench\AbstractPackageTestCase;

Expand All @@ -26,6 +24,6 @@ abstract class AbstractTestCase extends AbstractPackageTestCase
*/
protected function getServiceProviderClass($app): string
{
return \BrianFaust\Reportable\ReportableServiceProvider::class;
return \Pmochine\Report\ReportServiceProvider::class;
}
}
4 changes: 1 addition & 3 deletions tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/*
* This file is part of Laravel Reportable.
*
Expand All @@ -11,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace BrianFaust\Tests\Reportable;
namespace Pmochine\Tests\Report;

use GrahamCampbell\TestBenchCore\ServiceProviderTrait;

Expand Down

0 comments on commit 8390d0e

Please sign in to comment.