Skip to content
Snippets Groups Projects
ActorController.php 1.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • <?php
    
    /**
     * @copyright  2020 Podlibre
     * @license    https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
     * @link       https://castopod.org/
     */
    
    namespace App\Controllers;
    
    
    use ActivityPub\Controllers\ActorController as ActivityPubActorController;
    
    class ActorController extends ActivityPubActorController
    
        protected $helpers = ['auth', 'svg', 'components', 'misc'];
    
    
        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 = [
                    'actor' => $this->actor,
                ];
    
                return view('podcast/follow', $data, [
                    'cache' => DECADE,
                    'cache_name' => $cacheName,
                ]);
            }