-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
299 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataTransferObjects; | ||
|
||
use Carbon\Carbon; | ||
use Livewire\Wireable; | ||
|
||
readonly class NewsFeedItem implements Wireable | ||
{ | ||
public function __construct( | ||
public int $id, | ||
public string $title, | ||
public string $content, | ||
public Carbon $publishedAt, | ||
public NewsFeedItemAuthor $author, | ||
public array $embeds = [], | ||
public array $media = [], | ||
) { | ||
// | ||
} | ||
|
||
public function toLivewire(): array | ||
{ | ||
return [ | ||
'id' => $this->id, | ||
'title' => $this->title, | ||
'content' => $this->content, | ||
'publishedAt' => $this->publishedAt, | ||
'author' => $this->author, | ||
'embeds' => $this->embeds, | ||
'media' => $this->media, | ||
]; | ||
} | ||
|
||
public static function fromLivewire($value): static | ||
{ | ||
return new static(...$value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataTransferObjects; | ||
|
||
use Livewire\Wireable; | ||
|
||
readonly class NewsFeedItemAuthor implements Wireable | ||
{ | ||
public function __construct( | ||
public string $name, | ||
public string $avatar, | ||
) { | ||
// | ||
} | ||
|
||
public function toLivewire(): array | ||
{ | ||
return [ | ||
'name' => $this->name, | ||
'avatar' => $this->avatar, | ||
]; | ||
} | ||
|
||
public static function fromLivewire($value): static | ||
{ | ||
return new static(...$value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataTransferObjects; | ||
|
||
use Livewire\Wireable; | ||
|
||
readonly class NewsFeedItemEmbed implements Wireable | ||
{ | ||
public function __construct( | ||
public string $html, | ||
) { | ||
// | ||
} | ||
|
||
public function toLivewire(): array | ||
{ | ||
return [ | ||
'html' => $this->html, | ||
]; | ||
} | ||
|
||
public static function fromLivewire($value): static | ||
{ | ||
return new static(...$value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\DataTransferObjects; | ||
|
||
use Livewire\Wireable; | ||
|
||
readonly class NewsFeedItemMedia implements Wireable | ||
{ | ||
public function __construct( | ||
public string $name, | ||
public string $url, | ||
public string $thumb, | ||
) { | ||
// | ||
} | ||
|
||
public function toLivewire(): array | ||
{ | ||
return [ | ||
'name' => $this->name, | ||
'url' => $this->url, | ||
'thumbs' => $this->thumb, | ||
]; | ||
} | ||
|
||
public static function fromLivewire($value): static | ||
{ | ||
return new static(...$value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Spatie\MediaLibrary\MediaCollections\Models\Media as Model; | ||
|
||
class Media extends Model | ||
{ | ||
// | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
|
||
'navigation' => [ | ||
'newsfeed' => 'Newsfeed', | ||
'counters' => 'Counters', | ||
], | ||
|
||
]; |
Oops, something went wrong.