Use Model::find()

This commit is contained in:
RMartinOscar 2025-11-06 22:52:44 +00:00
parent fdfeee2150
commit 56739b6150
2 changed files with 2 additions and 4 deletions

View File

@ -16,8 +16,7 @@ class InstallPluginCommand extends Command
{
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
/** @var ?Plugin $plugin */
$plugin = Plugin::where('id', $id)->first();
$plugin = Plugin::find($id);
if (!$plugin) {
$this->error('Plugin does not exist!');

View File

@ -16,8 +16,7 @@ class UpdatePluginCommand extends Command
{
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
/** @var ?Plugin $plugin */
$plugin = Plugin::where('id', $id)->first();
$plugin = Plugin::find($id);
if (!$plugin) {
$this->error('Plugin does not exist!');