first commit
This commit is contained in:
21
app/Filters/Auth/Permissions.php
Normal file
21
app/Filters/Auth/Permissions.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Permissions extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('display_name', $query);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Auth/Roles.php
Normal file
21
app/Filters/Auth/Roles.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Roles extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('display_name', $query);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Auth/Users.php
Normal file
26
app/Filters/Auth/Users.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Auth;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Users extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
|
||||
public function role($roles)
|
||||
{
|
||||
return $this->where('user_roles.role_id', $roles);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Banking/Accounts.php
Normal file
21
app/Filters/Banking/Accounts.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Banking;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Accounts extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Banking/Transactions.php
Normal file
21
app/Filters/Banking/Transactions.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Banking;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Transactions extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('payment.name', $query)->whereLike('revenue.name', $query);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Banking/Transfers.php
Normal file
26
app/Filters/Banking/Transfers.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Banking;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Transfers extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function fromAccount($account_id)
|
||||
{
|
||||
return $this->where('payments.account_id', $account_id);
|
||||
}
|
||||
|
||||
public function toAccount($account_id)
|
||||
{
|
||||
return $this->related('revenue', 'revenues.account_id', '=', $account_id);
|
||||
}
|
||||
}
|
||||
22
app/Filters/Companies/Companies.php
Normal file
22
app/Filters/Companies/Companies.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Companies;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Companies extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
$this->related('settings','settings.key', '=',"'company_name'");
|
||||
return $this->related('settings','settings.value', 'LIKE',"'%" . $query . "%'");
|
||||
}
|
||||
}
|
||||
26
app/Filters/Customers/Invoices.php
Normal file
26
app/Filters/Customers/Invoices.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Customers;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Invoices extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('customer_name', $query);
|
||||
}
|
||||
|
||||
public function status($status)
|
||||
{
|
||||
return $this->where('invoice_status_code', $status);
|
||||
}
|
||||
}
|
||||
31
app/Filters/Customers/Payments.php
Normal file
31
app/Filters/Customers/Payments.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Customers;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Payments extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('description', $query);
|
||||
}
|
||||
|
||||
public function category($category)
|
||||
{
|
||||
return $this->where('category_id', $category);
|
||||
}
|
||||
|
||||
public function paymentMethod($payment_method)
|
||||
{
|
||||
return $this->where('payment_method', $payment_method);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Customers/Transactions.php
Normal file
21
app/Filters/Customers/Transactions.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Customers;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Transactions extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('payment.name', $query)->whereLike('revenue.name', $query);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Expenses/Bills.php
Normal file
26
app/Filters/Expenses/Bills.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Expenses;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Bills extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('vendor_name', $query);
|
||||
}
|
||||
|
||||
public function status($status)
|
||||
{
|
||||
return $this->where('bill_status_code', $status);
|
||||
}
|
||||
}
|
||||
31
app/Filters/Expenses/Payments.php
Normal file
31
app/Filters/Expenses/Payments.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Expenses;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Payments extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('description', $query);
|
||||
}
|
||||
|
||||
public function category($category)
|
||||
{
|
||||
return $this->where('category_id', $category);
|
||||
}
|
||||
|
||||
public function account($account)
|
||||
{
|
||||
return $this->where('account_id', $account);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Expenses/Vendors.php
Normal file
21
app/Filters/Expenses/Vendors.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Expenses;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Vendors extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Incomes/Customers.php
Normal file
21
app/Filters/Incomes/Customers.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Incomes;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Customers extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Incomes/Invoices.php
Normal file
26
app/Filters/Incomes/Invoices.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Incomes;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Invoices extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('customer_name', $query);
|
||||
}
|
||||
|
||||
public function status($status)
|
||||
{
|
||||
return $this->where('invoice_status_code', $status);
|
||||
}
|
||||
}
|
||||
31
app/Filters/Incomes/Revenues.php
Normal file
31
app/Filters/Incomes/Revenues.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Incomes;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Revenues extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function customer($customer)
|
||||
{
|
||||
return $this->where('customer_id', $customer);
|
||||
}
|
||||
|
||||
public function category($category)
|
||||
{
|
||||
return $this->where('category_id', $category);
|
||||
}
|
||||
|
||||
public function account($account)
|
||||
{
|
||||
return $this->where('account_id', $account);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Items/Items.php
Normal file
26
app/Filters/Items/Items.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Items;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Items extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
|
||||
public function category($id)
|
||||
{
|
||||
return $this->where('category_id', $id);
|
||||
}
|
||||
}
|
||||
26
app/Filters/Settings/Categories.php
Normal file
26
app/Filters/Settings/Categories.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Settings;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Categories extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
|
||||
public function type($type)
|
||||
{
|
||||
return $this->where('type', $type);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Settings/Currencies.php
Normal file
21
app/Filters/Settings/Currencies.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Settings;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Currencies extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
}
|
||||
21
app/Filters/Settings/Taxes.php
Normal file
21
app/Filters/Settings/Taxes.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filters\Settings;
|
||||
|
||||
use EloquentFilter\ModelFilter;
|
||||
|
||||
class Taxes extends ModelFilter
|
||||
{
|
||||
/**
|
||||
* Related Models that have ModelFilters as well as the method on the ModelFilter
|
||||
* As [relatedModel => [input_key1, input_key2]].
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $relations = [];
|
||||
|
||||
public function search($query)
|
||||
{
|
||||
return $this->whereLike('name', $query);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user