title: Notifications for comments not working in laravel
body: <p>error
  <a href="https://i.stack.imgur.com/giw1i.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>I am trying to send notifications of the event when some likes and comment on his post, notifications for comments and likes working
  here is my notification class.
  i have error in my CommentController <code>if ($event-&gt;user_id != $comment-&gt;user_id)</code></p>
  
  <pre>
  class NewCommentEvent extends Notification
  {
  
      use Queueable;
      protected $comment;
      /**
       * Create a new notification instance.
       *
       * @return void
       */
      public function __construct($comment)
      {
          $this->comment = $comment;
      }
  
      /**
       * Get the notification's delivery channels.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function via($notifiable)
      {
          return ['database'];
      }
  
      /**
       * Get the array representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function toDatabase($notifiable)
      {
          return [
              'comment' => $this->comment,
              'event' => Event::find($this->comment->event_id),
              'user' => User::find($this->comment->user_id)
          ];
      }
  
      /**
       * Get the array representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return array
       */
      public function toArray($notifiable)
      {
          return [
              //
          ];
      }
  }
  </pre>
  
  <p>My controller function code for notifications on comments</p>
  
  <pre>
   public function store(CommentRequest $request)
      {
  
  
          $event = Event::findOrFail($request->event_id);
  
  
          Comment::create([
              'comment' => $request->comment,
              'user_id' => Auth::id(),
              'event_id' => $event->id
          ]);
  
          if ($event->user_id != $comment->user_id) {
              $user = User::find($event->user_id);
              $user->notify(new NewCommentEvent($comment));
          }
  
  
  
          Toastr::success('Comment post with success','', ["positionClass" => "toast-top-center"]);
          return redirect()->back();
      }
  </pre>
  
  <p>my CommenRequest</p>
  
  <pre>
  namespace App\Http\Requests;
  
  use Illuminate\Foundation\Http\FormRequest;
  use Illuminate\Support\Facades\Auth;
  
  class CommentRequest extends FormRequest
  {
      /**
       * Determine if the user is authorized to make this request.
       *
       * @return bool
       */
      public function authorize()
      {
          return Auth::check();
      }
  
      /**
       * Get the validation rules that apply to the request.
       *
       * @return array
       */
      public function rules()
      {
          return [
              'comment' => 'required|max:2000',
          ];
      }
  }
  </pre>