original_string: public function preview($id)
      {
          $item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();
  
          if (in_array($item->notification->type->name, ['email', 'sms'])) {
              $classname    = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
              $notification = app($classname);
              $notification->setModel($item);
              return view('antares/notifications::admin.logs.preview', ['content' => $notification->render()]);
          }
  
          $decorator = app(SidebarItemDecorator::class);
          $decorated = $decorator->item($item, config('antares/notifications::templates.notification'));
          return new JsonResponse(['content' => $decorated], 200);
      }
code: public function preview($id)
      {
          $item = app(StackRepository::class)->fetchOne((int) $id)->firstOrFail();
  
          if (in_array($item->notification->type->name, ['email', 'sms'])) {
              $classname    = $item->notification->type->name === 'email' ? EmailNotification::class : SmsNotification::class;
              $notification = app($classname);
              $notification->setModel($item);
              return view('antares/notifications::admin.logs.preview', ['content' => $notification->render()]);
          }
  
          $decorator = app(SidebarItemDecorator::class);
          $decorated = $decorator->item($item, config('antares/notifications::templates.notification'));
          return new JsonResponse(['content' => $decorated], 200);
      }
code_tokens: public function preview ( $ id ) { $ item = app ( StackRepository :: class ) -> fetchOne ( ( int ) $ id ) -> firstOrFail ( ) ; if ( in_array ( $ item -> notification -> type -> name , [ 'email' , 'sms' ] ) ) { $ classname = $ item -> notification -> type -> name === 'email' ? EmailNotification :: class : SmsNotification :: class ; $ notification = app ( $ classname ) ; $ notification -> setModel ( $ item ) ; return view ( 'antares/notifications::admin.logs.preview' , [ 'content' => $ notification -> render ( ) ] ) ; } $ decorator = app ( SidebarItemDecorator :: class ) ; $ decorated = $ decorator -> item ( $ item , config ( 'antares/notifications::templates.notification' ) ) ; return new JsonResponse ( [ 'content' => $ decorated ] , 200 ) ; }
docstring: Preview notification log
  
  @param mixed $id
  @return View
docstring_tokens: Preview notification log