TplService.php 703 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Services\Common;
  3. use App\Repositories\TplRepository;
  4. use Illuminate\Support\Facades\DB;
  5. class TplService
  6. {
  7. /**
  8. * @var $tplRepository
  9. */
  10. protected $tplRepository;
  11. protected $tplStatus = true;
  12. /**
  13. * TaskService constructor.
  14. * @param TplRepository $tplRepository
  15. */
  16. public function __construct(TplRepository $tplRepository)
  17. {
  18. $this->tplRepository = $tplRepository;
  19. }
  20. public function getTpl($user)
  21. {
  22. $tpl = $this->tplRepository->findTpl(['tpl_type'=>$user->utype]);
  23. if($tpl->isEmpty()){
  24. $this->tplStatus = false;
  25. }
  26. return $this->tplStatus;
  27. }
  28. }