mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 03:57:45 +02:00
feat: add breadcrumb in admin area
- add Breadcrumb library and service - update authorizations - add missing routes to avoid 404 links in breadcrumb - add svg_helper globally in base controller - update purgecss config to check .ts files closes #17
This commit is contained in:
parent
ed6e953010
commit
7fb1de2cf3
35 changed files with 397 additions and 82 deletions
|
|
@ -12,6 +12,12 @@ class User extends \Myth\Auth\Entities\User
|
|||
*/
|
||||
protected $podcasts = [];
|
||||
|
||||
/**
|
||||
* The podcast user is contributing to
|
||||
* @var \App\Entities\Podcast
|
||||
*/
|
||||
protected $podcast;
|
||||
|
||||
/**
|
||||
* Array of field names and the type of value to cast them as
|
||||
* when they are accessed.
|
||||
|
|
@ -20,6 +26,7 @@ class User extends \Myth\Auth\Entities\User
|
|||
'active' => 'boolean',
|
||||
'force_pass_reset' => 'boolean',
|
||||
'podcast_role' => '?string',
|
||||
'podcast_id' => '?integer',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -41,4 +48,19 @@ class User extends \Myth\Auth\Entities\User
|
|||
|
||||
return $this->podcasts;
|
||||
}
|
||||
|
||||
public function getPodcast()
|
||||
{
|
||||
if (empty($this->podcast_id)) {
|
||||
throw new \RuntimeException(
|
||||
'Podcast_id must be set before getting podcast.'
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($this->podcast)) {
|
||||
$this->podcast = (new PodcastModel())->find($this->podcast_id);
|
||||
}
|
||||
|
||||
return $this->podcast;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue