Hello.
I am running components/view
as it is mentioned here https://github.com/mattstauffer/Torch/tree/master/components/view#usage, but when I try adding anonymous component, I get an error.
Updated templates/page.blade.php
:
@extends('layout')
@section('content')
<h1>{{ $title }}</h1>
<p>{{ $text }}</p>
<x-alert type="success" message="Good luck!" />
@endsection
The templates/components/alert.blade.php
:
@props([
'type' => 'info',
'message'
])
<div {{ $attributes->merge(['class' => 'alert alert-' . $type]) }}>
{{ $message }}
</div>
The error:
Illuminate\Contracts\Container\BindingResolutionException thrown with message
"Target [Illuminate\Contracts\View\Factory] is not instantiable."
Stacktrace:
#33 Illuminate\Contracts\Container\BindingResolutionException in
C:\OpenServer\domains\view\vendor\illuminate\container\Container.php:1017
#32 Illuminate\Container\Container:notInstantiable in
C:\OpenServer\domains\view\vendor\illuminate\container\Container.php:818
#31 Illuminate\Container\Container:build in C:\OpenServer\domains\view\vendor\illuminate\container\Container.php:691
#30 Illuminate\Container\Container:resolve in C:\OpenServer\domains\view\vendor\illuminate\container\Container.php:637
#29 Illuminate\Container\Container:make in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:221
#28 Illuminate\View\Compilers\ComponentTagCompiler:componentClass in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:185
#27 Illuminate\View\Compilers\ComponentTagCompiler:componentString in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:170
#26 Illuminate\View\Compilers\ComponentTagCompiler:Illuminate\View\Compilers\{closure} in [internal]:0
#25 preg_replace_callback in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:165
#24 Illuminate\View\Compilers\ComponentTagCompiler:compileSelfClosingTags in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:79
#23 Illuminate\View\Compilers\ComponentTagCompiler:compileTags in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\ComponentTagCompiler.php:66
#22 Illuminate\View\Compilers\ComponentTagCompiler:compile in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\BladeCompiler.php:322
#21 Illuminate\View\Compilers\BladeCompiler:compileComponentTags in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\BladeCompiler.php:222
#20 Illuminate\View\Compilers\BladeCompiler:compileString in
C:\OpenServer\domains\view\vendor\illuminate\view\Compilers\BladeCompiler.php:143
#19 Illuminate\View\Compilers\BladeCompiler:compile in
C:\OpenServer\domains\view\vendor\illuminate\view\Engines\CompilerEngine.php:51
#18 Illuminate\View\Engines\CompilerEngine:get in C:\OpenServer\domains\view\vendor\illuminate\view\View.php:139
#17 Illuminate\View\View:getContents in C:\OpenServer\domains\view\vendor\illuminate\view\View.php:122
#16 Illuminate\View\View:renderContents in C:\OpenServer\domains\view\vendor\illuminate\view\View.php:91
#15 Illuminate\View\View:render in C:\OpenServer\domains\view\index.php:57
#14 Closure:{closure} in C:\OpenServer\domains\view\vendor\slim\slim\Slim\Handlers\Strategies\RequestResponse.php:40
#13 call_user_func in C:\OpenServer\domains\view\vendor\slim\slim\Slim\Handlers\Strategies\RequestResponse.php:40
#12 Slim\Handlers\Strategies\RequestResponse:__invoke in
C:\OpenServer\domains\view\vendor\slim\slim\Slim\Route.php:281
#11 Slim\Route:__invoke in C:\OpenServer\domains\view\vendor\slim\slim\Slim\MiddlewareAwareTrait.php:117
#10 Slim\Route:callMiddlewareStack in C:\OpenServer\domains\view\vendor\slim\slim\Slim\Route.php:268
#9 Slim\Route:run in C:\OpenServer\domains\view\vendor\slim\slim\Slim\App.php:503
#8 Slim\App:__invoke in C:\OpenServer\domains\view\vendor\zeuxisoo\slim-
whoops\src\Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware.php:31
#7 Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware:__invoke in
C:\OpenServer\domains\view\vendor\slim\slim\Slim\DeferredCallable.php:57
#6 call_user_func_array in C:\OpenServer\domains\view\vendor\slim\slim\Slim\DeferredCallable.php:57
#5 Slim\DeferredCallable:__invoke in C:\OpenServer\domains\view\vendor\slim\slim\Slim\MiddlewareAwareTrait.php:70
#4 call_user_func in C:\OpenServer\domains\view\vendor\slim\slim\Slim\MiddlewareAwareTrait.php:70
#3 Slim\App:Slim\{closure} in C:\OpenServer\domains\view\vendor\slim\slim\Slim\MiddlewareAwareTrait.php:117
#2 Slim\App:callMiddlewareStack in C:\OpenServer\domains\view\vendor\slim\slim\Slim\App.php:392
#1 Slim\App:process in C:\OpenServer\domains\view\vendor\slim\slim\Slim\App.php:297
#0 Slim\App:run in C:\OpenServer\domains\view\index.php:60
Please help.