{"id":"53a6956203fd5ccd","repo":"laravel/framework","slug":"target-concrete-is-not-instantiable","errorCode":null,"errorMessage":"Target [$concrete] is not instantiable.","messagePattern":"Target \\[\\$concrete\\] is not instantiable\\.","errorType":"exception","errorClass":"BindingResolutionException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Container/Container.php","lineNumber":1436,"sourceCode":"    /**\n     * Throw an exception that the concrete is not instantiable.\n     *\n     * @param  string  $concrete\n     * @return void\n     *\n     * @throws \\Illuminate\\Contracts\\Container\\BindingResolutionException\n     */\n    protected function notInstantiable($concrete)\n    {\n        if (! empty($this->buildStack)) {\n            $previous = implode(', ', $this->buildStack);\n\n            $message = \"Target [$concrete] is not instantiable while building [$previous].\";\n        } else {\n            $message = \"Target [$concrete] is not instantiable.\";\n        }\n\n        throw new BindingResolutionException($message);\n    }\n\n    /**\n     * Throw an exception for an unresolvable primitive.\n     *\n     * @return void\n     *\n     * @throws \\Illuminate\\Contracts\\Container\\BindingResolutionException\n     */\n    protected function unresolvablePrimitive(ReflectionParameter $parameter)\n    {\n        $message = \"Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}\";\n\n        throw new BindingResolutionException($message);\n    }\n\n    /**\n     * Register a new before resolving callback for all types.","sourceCodeStart":1418,"sourceCodeEnd":1454,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Container/Container.php#L1418-L1454","documentation":"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.","triggerScenarios":"Calling app()->make(SomeInterface::class) or app()->make(AbstractBase::class) directly where no binding is registered for that abstract.","commonSituations":"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.","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."],"exampleFix":"// before\napp()->make(\\App\\Contracts\\Cacheable::class);\n\n// after\napp()->bind(\\App\\Contracts\\Cacheable::class, \\App\\Services\\RedisCache::class);\napp()->make(\\App\\Contracts\\Cacheable::class);","handlingStrategy":"validation","validationCode":"if (! app()->bound($abstract) && (interface_exists($abstract) || (new \\ReflectionClass($abstract))->isAbstract())) {\n    throw new \\LogicException(\"{$abstract} has no binding\");\n}\napp()->make($abstract);","typeGuard":"function isResolvableAbstract(string $abstract, \\Illuminate\\Container\\Container $c): bool\n{\n    return $c->bound($abstract) || (class_exists($abstract) && (new \\ReflectionClass($abstract))->isInstantiable());\n}","tryCatchPattern":"use Illuminate\\Contracts\\Container\\BindingResolutionException;\ntry {\n    app()->make($abstract);\n} catch (BindingResolutionException $e) {\n    if ($e->getMessage() === \"Target [{$abstract}] is not instantiable.\") {\n        app()->bind($abstract, $fallback);\n    }\n    throw $e;\n}","preventionTips":["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."],"tags":["container","binding","interface","di"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}