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
<?php | |
// ... | |
public function boot() | |
{ | |
parent::boot(); | |
// Let Nova know where your compiled assets will be. | |
Nova::serving(function (ServingNova $event) { |
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
<?php | |
// ... | |
protected function routes() | |
{ | |
Nova::routes() | |
->withAuthenticationRoutes() | |
->withPasswordResetRoutes() | |
->register(); |
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
<?php | |
use App\Nova\Cards\CustomCard; | |
// ... | |
protected function cards() | |
{ | |
return [ | |
new CustomCard, |
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
<?php | |
// ... | |
public static function fake($disk = null, array $config = []) { | |
$disk = $disk ?: static::$app['config']->get('filesystems.default'); | |
(new Filesystem)->cleanDirectory( | |
$root = storage_path('framework/testing/disks/'.$disk) | |
); |
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
<?php | |
namespace Tests; | |
use Storage; | |
use Illuminate\Filesystem\Filesystem; | |
trait CreatesFakeStorage | |
{ | |
/** |
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
interface CanBroadcast { | |
send(event: Event, user: User) | |
trackReads(track: boolean) | |
} | |
class EmailBroadcaster implements CanBroadcast { | |
send(event: Event, user: User) { | |
emailService.send({ to: user.email, subject: event.name }) | |
} | |
trackReads(track: boolean) { |
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
interface CanBroadcast { | |
send(event: Event, user: User) | |
} | |
interface CanTrackReads { | |
trackReads(track: boolean); | |
} | |
class EmailBroadcaster implements CanBroadcast, CanTrackReads { | |
send(event: Event, user: User) { |
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
class EmailBroadcaster { | |
send(event: Event, user: User) { | |
const description = `New event ${event.name} occured at ${event.getTimestamp()}` | |
emailService.send({ to: user.email, subject: event.name, body: description }) | |
} | |
} | |
class NotificationHandler { | |
private mailer: EmailBroadcaster |
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
interface Broadcaster { | |
send(event: Event, user: User) | |
} | |
class EmailBroadcaster implements Broadcaster { | |
send(event: Event, user: User) { | |
const description = `New event ${event.name} occured at ${event.getTimestamp()}` | |
emailService.send({ to: user.email, subject: event.name, body: description }) | |
} | |
} |
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
const processUser = functions.firestore | |
.document("accounts/{accountId}/users/{userId}") | |
.onCreate(async (snapshot, context) => { | |
await processTheUser(snapshot); | |
const event = new UserProcessed(snapshot); | |
await new Account(context.params.accountId).addEvent(event); | |
}) |
OlderNewer