'How get laravel 8 notifications by notification type?

I have created two types of notification in laravel

  1. Purchase and Sale
  2. Product Order

How can I display two notifications type in laravel ?

{{Auth::user()->unreadNotifications}}

NOTIFICATIONS TABLE SCHEMA

public function up()     {   
Schema::create('notifications', function (Blueprint $table) {             

$table->uuid('id')->primary();   
$table->string('type');
$table->morphs('notifiable');             
$table->text('data'); 
$table->timestamp('read_at')->nullable();             
$table->timestamps();         
});

it gives me all the notifications how can I seperate them or fetch only particular type of notifications from notification table...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source