| 1 | <?php |
||
| 7 | class EloquentRepository implements Repository |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var \Yajra\CMS\Entities\Extension |
||
| 11 | */ |
||
| 12 | protected $extension; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * EloquentRepository constructor. |
||
| 16 | * |
||
| 17 | * @param \Yajra\CMS\Entities\Extension $extension |
||
| 18 | */ |
||
| 19 | public function __construct(Extension $extension) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Install an extension. |
||
| 26 | * |
||
| 27 | * @param string $type |
||
| 28 | * @param array $attributes |
||
| 29 | * @return \Yajra\CMS\Entities\Extension |
||
| 30 | */ |
||
| 31 | public function install($type, array $attributes) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Uninstall extension. |
||
| 47 | * |
||
| 48 | * @param int $id |
||
| 49 | * @throws \Exception |
||
| 50 | */ |
||
| 51 | public function uninstall($id) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get all extensions. |
||
| 60 | * |
||
| 61 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
| 62 | */ |
||
| 63 | public function all() |
||
| 67 | |||
| 68 | /** |
||
| 69 | * Find or fail an extension. |
||
| 70 | * |
||
| 71 | * @param int $id |
||
| 72 | * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model |
||
| 73 | */ |
||
| 74 | public function findOrFail($id) |
||
| 78 | } |
||
| 79 |