How to call a function from another route in laravel php

You don't need isempty inside controller, just add method isempty inside Notification model, you can use something like this inside Notification model:

public static function isEmpty(){
    return Notification::first() ? true : false;
}

And then where you need to check if notification table is empty just call Notification::isEmpty()