Files
aroginhealthcare/app/View/Components/BlogInfo.php
2025-08-17 16:23:14 +05:45

34 lines
859 B
PHP

<?php
namespace App\View\Components;
use Closure;
use Illuminate\View\Component;
use Modules\Blog\app\Models\Blog;
use Illuminate\Contracts\View\View;
use Modules\Setting\app\Models\Setting;
use Modules\TeamMember\app\Models\SocialShare;
class BlogInfo extends Component
{
/**
* Create a new component instance.
*/
public $authorIntro;
public function __construct($authorIntroduction)
{
$this->authorIntro = $authorIntroduction;
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
$data['blogs'] = Blog::where('status', 'active')->latest()->take(6)->get();
$data['socialMediaShares'] = Setting::where('setting_name', 'social_media_share')->take(6)->get();
return view('components.blog-info', $data);
}
}