You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have one doubth, how to load one method (...RepositoryEloquent) of other CustomerRepositoryEloquent
Example:
<?php
namespace App\Repositories;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Entities\Tax;
use App\Validators\TaxValidator;
class TaxRepositoryEloquent extends BaseRepository implements TaxRepository
{
public function model()
{
return Tax::class;
}
public function getTaxOfAmount($amount)
{
$tax = $this->find(config('company.tax'));
$get_irpf = $tax->value*($amount/100);
return $get_irpf;
}
public function boot()
{
$this->pushCriteria(app(RequestCriteria::class));
}
}
Now, how to load the method getTaxOfAmount in my other CustomRepositoryEloquent ?
<?php
namespace App\Repositories;
use Prettus\Repository\Eloquent\BaseRepository;
use Prettus\Repository\Criteria\RequestCriteria;
use App\Entities\Custom;
use App\Validators\TaxValidator;
class CustomRepositoryEloquent extends BaseRepository implements CustomRepository
{
public function model()
{
return Custom::class;
}
public function getCustom()
{
//How to load getTaxOfAmount?
}
public function boot()
{
$this->pushCriteria(app(RequestCriteria::class));
}
}
Thanks.
The text was updated successfully, but these errors were encountered:
Hi,
I have one doubth, how to load one method (...RepositoryEloquent) of other CustomerRepositoryEloquent
Example:
Now, how to load the method getTaxOfAmount in my other CustomRepositoryEloquent ?
Thanks.
The text was updated successfully, but these errors were encountered: