Ray Lee | 李宗叡
Learn or Die
Published in
Jun 15, 2024

# Show Events in the model:show Command

11.8 開始,Artisan command model:show 可以列出 defined events

# New contains Validation Rule

11.8 新增 array contains rule

<?php
return [
'allowed_ips' => ['present', 'nullable', 'array', 'contains:' . $request->ip()],
'allowed_ips.*' => ['required', 'ip'],
];

# Ability to Manually Fail a Command

11.8 可以 fail a command outside of handle method,細節可參考 PR

<?php
public function handle()
{
$this->trigger_failure();
}

protected function trigger_failure()
{
$this->fail('Whoops!');
}

# Create a Blade View With make:mail

11.8 開始,make:mail artisan command 也可以產生 View Blade file

php artisan make:mail OrderShipped --view=mail.orders.shipped

# 參考來源

Laravel News

--

--

Ray Lee | 李宗叡
Learn or Die

It's Ray. I do both backend and frontend, but more focus on backend. I like coding, and would like to see the whole picture of a product.