سلام وقتتون بخیر
یک ارور هست که هر کاری میکنم برطرف نمیشه ممنون میشم راهنماییم کنید
متن ارور:
Undefined variable: video (View: C:\\xampp1\\htdocs\\new-laravel\\resources\\views\\videos\\show.blade.php)
قسمتی که ارور گرفته میشه:
<x-relatived-videos :video="$video"/>
کامپوننت بلید ساخته شده:
<div class="col-md-4">
<div id="related-posts">
@foreach ($videos as $video)
<div class="related-video-item">
<div class="thumb">
<small class="time">{{ $video->length }}small>
<a href="{{ route('videos.show', $video->id) }}"><img src="{{ $video->thumbnail }}" alt="">a>
div>
<a href="{{ route('videos.show', $video->id) }}" class="title">{{ $video->name }}a>
<a class="channel-name" href="#">داود طاهری<span>
<i class="fa fa-check-circle">i>span>a>
div>
@endforeach
div>
div>
کامپوننت درون view:
namespace App\\View\\Components;
use App\\Models\\Video;
use Illuminate\\View\\Component;
class RelativedVideos extends Component
{
public $videos;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(Video $video)
{
$this->videos = $video->relatedVideos(10);
}
/**
* Get the view / contents that represent the component.
*
* @return \\Illuminate\\Contracts\\View\\View|\\Closure|string
*/
public function render()
{
return view('components.relatived-videos');
}
}
ممنون میشم که راهنمایی کنید این ارور از کجا میاد