src/Processor/LogsProcessor.php
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);
    }
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);
    }
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 ) ; }
Preview notification log

@param mixed $id
@return View
Preview notification log