This file contains hidden or 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
<?php | |
dispatch(function () use ($uuid) { | |
PostAggregateRoot::retrieve($uuid) | |
->publish() | |
->persist(); | |
})->delay($request->publish_date); |
This file contains hidden or 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
<?php | |
class PostAggregateRoot | |
{ | |
public function applyPostPublished(PostPublished $event) { | |
$this->status = 'future'; | |
$this->publishDate = $event->publishDate; | |
} | |
public function timeElapsed(DateTime $now) { |
This file contains hidden or 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
<?php | |
class PostAggregateRoot | |
{ | |
public function publishPost(DateTime $when) { | |
$this->recordThat(new PostPublishScheduled($when)); | |
if ($when < now()) { | |
$this->recordThat(new PostPublished()); | |
} |
This file contains hidden or 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
<?php | |
class PostAggregateRoot | |
{ | |
public function publishPost(DateTime $when) { | |
$this->recordThat(new PostPublishScheduled($when)); | |
if ($when < now()) { | |
$this->recordThat(new PostPublished()); | |
} |
This file contains hidden or 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
<?php | |
dispatch(function () use ($uuid) { | |
PostAggregateRoot::retrieve($uuid) | |
->publish() | |
->persist(); | |
})->delay($request->publish_date); |
This file contains hidden or 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
<?php | |
public function getCurrentStatusAttribute() | |
{ | |
if ($this->status === 'published') { | |
return $this->publish_date?->lessThan(now()) ? 'published' : 'future'; | |
} | |
return $status; | |
} |
This file contains hidden or 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
<footer class="-sm:text-center">Centered on mobile, back to default for bigger screens</footer> | |
<img class="-sm:hidden">Hidden only on mobile to save space</img> | |
<body class="-sm:p-4">Only apply padding on mobile so text isn't hard against the screen</body> | |
<sidebar class="hidden @md:show">Only this on medium sized screens</sidebar> |
This file contains hidden or 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
const colors = require('tailwindcss/colors') | |
module.exports = { | |
theme: { | |
extend: { | |
screens: { | |
'-2xl': { max: '1535px' }, | |
'-xl': { max: '1279px' }, | |
'-lg': { max: '1023px' }, | |
'-md': { max: '767px' }, |
This file contains hidden or 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
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; | |
use Illuminate\Database\Eloquent\Model; | |
/** | |
* @property int $id | |
* @property int $project_id |
This file contains hidden or 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
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Support\Facades\Storage; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; | |
use Laravel\Scout\Searchable; | |
trait BuildBehaviour |
NewerOlder