firstcommit
This commit is contained in:
33
app/View/Components/BlogInfo.php
Normal file
33
app/View/Components/BlogInfo.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user