Skip to content
Snippets Groups Projects
ActorController.php 1.29 KiB
Newer Older
  • Learn to ignore specific revisions
  • /**
     * @copyright  2020 Podlibre
     * @license    https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
     * @link       https://castopod.org/
     */
    
    namespace App\Controllers;
    
    
    use Modules\Fediverse\Controllers\ActorController as FediverseActorController;
    
    class ActorController extends FediverseActorController
    
        protected $helpers = ['auth', 'svg', 'components', 'misc', 'seo'];
    
        public function follow(): string
    
            // Prevent analytics hit when authenticated
    
                $this->registerPodcastWebpageHit($this->actor->podcast->id);
            }
    
    
            $cacheName = "page_podcast-{$this->actor->username}_follow";
    
            if (! ($cachedView = cache($cacheName))) {
    
                helper(['form', 'components', 'svg']);
                $data = [
    
                    // @phpstan-ignore-next-line
                    'metatags' => get_follow_metatags($this->actor),
    
                    'actor' => $this->actor,
                ];
    
                return view('podcast/follow', $data, [
                    'cache' => DECADE,
                    'cache_name' => $cacheName,
                ]);
            }