laravel/framework · error · BindingResolutionException
Target [$concrete] is not instantiable.
Error message
Target [$concrete] is not instantiable.
What it means
Thrown by Container::notInstantiable when the concrete being resolved is not instantiable (interface, abstract class, or trait) and the buildStack is empty — meaning the user directly asked for a non-instantiable type at the top level. Same code path as the 'while building' variant but without the dependency-chain suffix.
Source
Thrown at src/Illuminate/Container/Container.php:1436
/**
* Throw an exception that the concrete is not instantiable.
*
* @param string $concrete
* @return void
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
protected function notInstantiable($concrete)
{
if (! empty($this->buildStack)) {
$previous = implode(', ', $this->buildStack);
$message = "Target [$concrete] is not instantiable while building [$previous].";
} else {
$message = "Target [$concrete] is not instantiable.";
}
throw new BindingResolutionException($message);
}
/**
* Throw an exception for an unresolvable primitive.
*
* @return void
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
protected function unresolvablePrimitive(ReflectionParameter $parameter)
{
$message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}";
throw new BindingResolutionException($message);
}
/**
* Register a new before resolving callback for all types.View on GitHub (pinned to bd6b5437e6)
Solutions
- Register a binding before resolving: $this->app->bind(Interface::class, Concrete::class).
- Resolve the concrete class directly instead of the interface.
- If using facades, ensure the service is registered under the facade's accessors key.
Example fix
// before app()->make(\App\Contracts\Cacheable::class); // after app()->bind(\App\Contracts\Cacheable::class, \App\Services\RedisCache::class); app()->make(\App\Contracts\Cacheable::class);
Defensive patterns
Strategy: validation
Validate before calling
if (! app()->bound($abstract) && (interface_exists($abstract) || (new \ReflectionClass($abstract))->isAbstract())) {
throw new \LogicException("{$abstract} has no binding");
}
app()->make($abstract); Type guard
function isResolvableAbstract(string $abstract, \Illuminate\Container\Container $c): bool
{
return $c->bound($abstract) || (class_exists($abstract) && (new \ReflectionClass($abstract))->isInstantiable());
} Try / catch
use Illuminate\Contracts\Container\BindingResolutionException;
try {
app()->make($abstract);
} catch (BindingResolutionException $e) {
if ($e->getMessage() === "Target [{$abstract}] is not instantiable.") {
app()->bind($abstract, $fallback);
}
throw $e;
} Prevention
- Never call make() on an interface without a registered binding.
- Centralise interface bindings in AppServiceProvider.
- Add a boot-time assertion that lists every resolvable abstract.
When it happens
Trigger: Calling app()->make(SomeInterface::class) or app()->make(AbstractBase::class) directly where no binding is registered for that abstract.
Common situations: Directly resolving an interface from the container instead of its concrete; refactoring a singleton into an interface but forgetting the binding; facades pointing at an interface without a binding; asking for a trait.
Related errors
- Target [$concrete] is not instantiable while building [$prev
- {self::class}::bind(): Argument #2 ($concrete) must be of ty
- The environment property must be set and cannot be empty.
- Method not provided.
- Unable to resolve dependency [{$parameter}] in class {$param
AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06).
Data as JSON: /data/errors/53a6956203fd5ccd.json.
Report an issue: GitHub.