Call to undefined method Illuminate\Notifications\Notification::send()
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
# Solving the Mystery: Call to undefined method Illuminate\Notifications\Notification::send() in Laravel
Building a robust notification system is one of the most rewarding parts of developing a Laravel application. It allows you to keep users informed about important events, whether through emails, database entries, or other channels. However, as we dive into custom implementationsâlike creating custom notification classesâwe often run into subtle errors regarding how Laravel handles those interactions.
Today, we are going to dissect a very common stumbling block: the error `Call to undefined method Illuminate\Notifications\Notification::send()`. I will walk you through why this error occurs, analyze your specific code, and provide the correct, idiomatic Laravel solution.
## Understanding the Error: Static vs. Instance Methods
The core of the problem lies in how you are attempting to use the `Notification` class. In object-oriented programming, methods can be called either statically (on the class itself) or on an instance of that class.
When you try to call `Notification::send($user, ...)`:
1. You are attempting to call a static method (`send`) directly on the `Notification` facade/class.
2. In many contexts within Laravel, especially when dealing with sending notifications to specific models, the intended pattern is usually to call the method *on the model instance* itself, or use the `notify()` method provided by the model trait.
The error suggests that the specific context you are operating in does not recognize the static `send` method on the base `Notification` class in the way you invoked it. This often happens when developers mix up calling a general facade with sending notifications to specific, related models.
## Diagnosing Your Notification Implementation
Let's look at your setup:
You created a notification class (`AddPost.php`) which correctly implements the necessary methods like `via()` and `toArray()`. You are trying to send it from your controller:
```php
// In PostNot.php controller
Notification::send($user, new AddPost($post)); // This caused the error
```
The issue isn't necessarily that the notification class is broken; it's how you are attempting to dispatch the notification across multiple users. You are trying to use a static method on the `Notification` class to handle communication for an entire set of users, which isn't the intended flow when dealing with Eloquent models.
## The Correct Approach: Iterating and Notifying Models
Instead of trying to call a generic static method, you should leverage the relationship defined in your application to iterate over the relevant users and tell *each* user to notify themselves. This aligns perfectly with Laravel's focus on Eloquent relationships and model-centric operations, which is a key principle when working with frameworks like those promoted by [Laravel](https://laravelcompany.com).
If you want to send a notification to every user who should receive it (for example, all users in the system), you should iterate through your collection of users and call the `notify` method on each one.
### Corrected Controller Logic
Assuming your controller needs to find all users and notify them based on the new post:
```php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Post;
use App\User;
use Illuminate\Support\Facades\Notification; // Import the facade
class PostNot extends Controller
{
public function store(Request $request)
{
$post = new Post();
$post->title = $request->title;
$post->description = $request->description;
$post->view = 0;
if ($post->save()) {
// 1. Retrieve the users you want to notify (e.g., all active users)
$users = User::where('is_active', true)->get(); // Example filtering
// 2. Iterate and send the notification to each user instance
foreach ($users as $user) {
// Use the model's instance method 'notify'
$user->notify(new \App\Notifications\AddPost($post));
}
}
return redirect()->route('chat');
}
}
```
### Best Practice Refinements
Notice that instead of relying on a generic static `Notification::send()`, we are now using the instance method `$user->notify(...)`. This is the recommended, object-oriented way to handle notifications in Laravel. It ensures that the notification context is tied directly to the specific user model, making your code cleaner, more testable, and less prone to these kinds of fatal errors.
When working with complex data flows like this, always favor Eloquent relationships (`hasMany`, `belongsTo`) and direct model interactions over relying solely on static facade methods unless you are specifically using a global broadcast mechanism. For deeper dives into how models interact in Laravel, I highly recommend exploring the official documentation at [laravelcompany.com](https://laravelcompany.com).
## Conclusion
The error `Call to undefined method Illuminate\Notifications\Notification::send()` is a classic indicator that the chosen method signature does not match the expected behavior of the class you are interacting with. By shifting from a static facade call (`Notification::send()`) to iterating over your Eloquent models and calling the instance method (`$user->notify(...)`), you resolve the error, implement robust notification logic, and adhere to modern Laravel development best practices. Keep experimenting, and happy coding!