refactored report and update abstracts
This commit is contained in:
parent
eef7eaa12f
commit
51a7fa86fc
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Abstracts\Reports;
|
||||
namespace App\Abstracts\Listeners;
|
||||
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
@ -12,7 +12,7 @@ use App\Models\Setting\Category;
|
||||
use App\Traits\Contacts;
|
||||
use Date;
|
||||
|
||||
abstract class Listener
|
||||
abstract class Report
|
||||
{
|
||||
use Contacts;
|
||||
|
@ -1,31 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Update;
|
||||
namespace App\Abstracts\Listeners;
|
||||
|
||||
class Listener
|
||||
abstract class Update
|
||||
{
|
||||
const ALIAS = '';
|
||||
|
||||
const VERSION = '';
|
||||
|
||||
/**
|
||||
* Check if should listen.
|
||||
* Check the fired update based on alias and version.
|
||||
*
|
||||
* @param $event
|
||||
* @return boolean
|
||||
*/
|
||||
protected function check($event)
|
||||
public function skipThisUpdate($event)
|
||||
{
|
||||
// Apply only to the specified alias
|
||||
if ($event->alias != static::ALIAS) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Do not apply to the same or newer versions
|
||||
if (version_compare($event->old, static::VERSION, '>=')) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.0
|
||||
*/
|
||||
public function check($event)
|
||||
{
|
||||
return !$this->skipThisUpdate($event);
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Abstracts\Reports;
|
||||
namespace App\Abstracts;
|
||||
|
||||
use App\Exports\Common\Reports as Export;
|
||||
use App\Models\Common\Report as Model;
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
use App\Events\Common\ReportFilterApplying;
|
||||
use App\Events\Common\ReportFilterShowing;
|
||||
use App\Events\Common\ReportGroupApplying;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
|
||||
class ProfitLossReport extends Listener
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Listeners\Common;
|
||||
|
||||
use App\Abstracts\Reports\Listener;
|
||||
use App\Abstracts\Listeners\Report as Listener;
|
||||
|
||||
class TaxSummaryReport extends Listener
|
||||
{
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V10;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use File;
|
||||
|
||||
class Version106 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V10;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use DB;
|
||||
|
||||
class Version107 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V10;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Expense\BillStatus;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V10;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Common\Company;
|
||||
use Artisan;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V11;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V11;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Common\Company;
|
||||
use App\Utilities\Installer;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V11;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Setting\Currency;
|
||||
use Artisan;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V11;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use App\Models\Common\Company;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Artisan;
|
||||
|
||||
class Version1210 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Artisan;
|
||||
|
||||
class Version1211 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Permission;
|
||||
use File;
|
||||
use Illuminate\Support\Str;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V12;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Artisan;
|
||||
|
||||
class Version129 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use Artisan;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use Artisan;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Common\Company;
|
||||
use App\Utilities\Installer;
|
||||
use Artisan;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Common\Company;
|
||||
use App\Utilities\Overrider;
|
||||
use App\Models\Banking\Account;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
use Artisan;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Date;
|
||||
|
||||
class Version135 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Date;
|
||||
|
||||
class Version138 extends Listener
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Income\InvoiceItem;
|
||||
use App\Models\Income\InvoiceItemTax;
|
||||
use App\Models\Setting\Tax;
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V20;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use App\Models\Auth\User;
|
||||
use App\Models\Auth\Role;
|
||||
use App\Models\Auth\Permission;
|
||||
@ -32,8 +32,7 @@ class Version200 extends Listener
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
// Check if should listen
|
||||
if (!$this->check($event)) {
|
||||
if ($this->skipThisUpdate($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Listeners\Update\V13;
|
||||
|
||||
use App\Abstracts\Listeners\Update as Listener;
|
||||
use App\Events\Install\UpdateFinished as Event;
|
||||
use App\Listeners\Update\Listener;
|
||||
use Artisan;
|
||||
|
||||
class Version201 extends Listener
|
||||
@ -20,8 +20,7 @@ class Version201 extends Listener
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
// Check if should listen
|
||||
if (!$this->check($event)) {
|
||||
if ($this->skipThisUpdate($event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Reports;
|
||||
|
||||
use App\Abstracts\Reports\Report;
|
||||
use App\Abstracts\Report;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Utilities\Recurring;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Reports;
|
||||
|
||||
use App\Abstracts\Reports\Report;
|
||||
use App\Abstracts\Report;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Income\Invoice;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Reports;
|
||||
|
||||
use App\Abstracts\Reports\Report;
|
||||
use App\Abstracts\Report;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Income\Invoice;
|
||||
use App\Utilities\Recurring;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Reports;
|
||||
|
||||
use App\Abstracts\Reports\Report;
|
||||
use App\Abstracts\Report;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Income\Invoice;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Reports;
|
||||
|
||||
use App\Abstracts\Reports\Report;
|
||||
use App\Abstracts\Report;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Expense\Bill;
|
||||
use App\Models\Income\Invoice;
|
||||
|
Loading…
x
Reference in New Issue
Block a user