Bristol SU Support Package
LogicRepository.php
Go to the documentation of this file.
1 <?php
2 
3 
5 
6 
7 use BristolSU\Support\Logic\Contracts\LogicRepository as LogicRepositoryContract;
9 
13 class LogicRepository implements LogicRepositoryContract
14 {
15 
28  public function create(array $attributes)
29  {
30  return Logic::create($attributes);
31  }
32 
38  public function all()
39  {
40  return Logic::all();
41  }
42 
50  public function getById(int $id): Logic
51  {
52  return Logic::findOrFail($id);
53  }
54 
63  public function update(int $id, array $attributes): Logic
64  {
65  $logic = $this->getById($id);
66  $logic->fill($attributes);
67  $logic->save();
68  return $logic;
69  }
70 
78  public function delete(int $id)
79  {
80  $logic = $this->getById($id);
81  $logic->delete();
82  }
83 
84 
85 }
update(int $id, array $attributes)