-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathBanner.php
executable file
·60 lines (54 loc) · 1.83 KB
/
Banner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace App\View\Components\Docs;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class Banner extends Component
{
public string $title;
public string $image;
public string $href;
/**
* Create a new component instance.
*/
public function __construct()
{
$banner = collect([
[
'title' => 'Поделитесь своим кодом и идеями!',
'image' => asset('/img/ui/doc-banners/pastebin.svg'),
'href' => route('pastebin'),
],
[
'title' => 'Поддержите нас - каждый вклад важен!',
'image' => asset('/img/ui/doc-banners/donate.svg'),
'href' => route('donate'),
],
[
'title' => 'Будьте в курсе последних новостей!',
'image' => asset('/img/ui/doc-banners/feed.svg'),
'href' => route('feed'),
],
[
'title' => 'Ищете работу? Мы поможем!',
'image' => asset('/img/ui/doc-banners/jobs.svg'),
'href' => route('jobs'),
],
[
'title' => 'Примите наш вызов и улучшите свои навыки!',
'image' => asset('/img/ui/doc-banners/challenges.svg'),
'href' => route('challenges'),
],
])->random();
$this->title = $banner['title'];
$this->image = $banner['image'];
$this->href = $banner['href'];
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.docs.banner');
}
}