first commit
This commit is contained in:
		
							
								
								
									
										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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user