| 1 | <?php |
||
| 7 | class Repository |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $widgets = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param string $widget |
||
| 16 | * @param string $description |
||
| 17 | * @param string $classPath |
||
| 18 | * @param array $templates |
||
| 19 | * @return $this |
||
| 20 | */ |
||
| 21 | public function register($widget, $description, $classPath, $templates = []) |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Find or fail a widget. |
||
| 30 | * |
||
| 31 | * @param string $widget |
||
| 32 | * @return \Yajra\CMS\Widgets\Widget |
||
| 33 | * @throws \Yajra\CMS\Widgets\NotFoundException |
||
| 34 | */ |
||
| 35 | public function findOrFail($widget) |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get all registered widgets. |
||
| 46 | * |
||
| 47 | * @return \Illuminate\Support\Collection |
||
| 48 | */ |
||
| 49 | public function all() |
||
| 53 | } |
||
| 54 |