for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Xetaravel\View\Components;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\URL;
use Illuminate\View\Component;
use Closure;
class Meta extends Component
{
/**
* The meta title.
*
* @var string
*/
public $title;
* The meta author.
public $author;
* The meta description.
public $description;
* The meta url.
public $url;
* The meta image.
public $image;
* The meta copyright.
public $copyright;
* Create a new meta component instance.
* @return void
public function __construct(
string $title = null,
string $author = null,
string $url = null,
string $description = null
) {
$this->title = $title ? Str::of($title)->limit(60, '...') . ' - Xetaravel' : config('xetaravel.site.title');
$this->author = $author ?? config('xetaravel.site.copyright');
$this->url = $url ?? URL::full();
$this->description =
$description ? Str::of(strip_tags($description))->limit(150, '...') : config('xetaravel.site.description');
$this->copyright = config('xetaravel.site.copyright');
$this->image = URL::asset('images/logo300x300.png');
}
* Get the view / contents that represent the component.
* @return \Illuminate\Contracts\View\View|Closure|string
public function render()
return view('components.meta');