![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/app/Shop/EmailSettings/Repositories/ |
<?php namespace App\Shop\EmailSettings\Repositories; use App\Shop\EmailSettings\EmailSetting; use Illuminate\Support\Collection; use Jsdecena\Baserepo\BaseRepository; use Illuminate\Database\QueryException; use Illuminate\Database\Eloquent\ModelNotFoundException; use App\Shop\EmailSettings\Repositories\Interfaces\EmailSettingRepositoryInterface; use App\Shop\Tools\UploadableTrait; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; class EmailSettingRepository extends BaseRepository implements EmailSettingRepositoryInterface { /** * FaqRepository constructor. * * @param EmailSetting $emailSetting */ public function __construct(EmailSetting $emailSetting) { parent::__construct($emailSetting); $this->model = $emailSetting; } /** * List all the EmailSetting * * @param string $order * @param string $sort * @param array $except * @return \Illuminate\Support\Collection */ public function listEmailSetting(string $order = 'id', string $sort = 'desc', $except = []) : Collection { return $this->model->orderBy($order, $sort)->get()->except($except); } /** * Create EmailSetting * * @param array $params * * @return EmailSetting * @throws InvalidArgumentException */ public function createEmailSetting(array $params) : EmailSetting { try { return EmailSetting::create($params); } catch (QueryException $e) { throw new \InvalidArgumentException($e->getMessage()); } } /** * Update the dummy * * @param array $params * @return EmailSetting */ public function updateEmailSetting(array $params) : EmailSetting { $course = $this->findEmailSettingById($this->model->id); $course->update($params); return $course; } /** * @param int $id * * @return EmailSetting * @throws ModelNotFoundException */ public function findEmailSettingById(int $id) : EmailSetting { try { return $this->findOneOrFail($id); } catch (ModelNotFoundException $e) { throw new ModelNotFoundException($e->getMessage()); } } /** * Delete a dummy * * @return bool */ public function deleteEmailSetting() : bool { return $this->model->delete(); } /** * @param int $id * * @return EmailSetting * @throws ModelNotFoundException */ public function findEmailSettingBySlug(array $array) : EmailSetting { try { return $this->findOneByOrFail($array); } catch (ModelNotFoundException $e) { throw new ModelNotFoundException($e->getMessage()); } } }