mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 12:29:29 +01:00
Use Model::find()
This commit is contained in:
parent
fdfeee2150
commit
56739b6150
@ -16,8 +16,7 @@ class InstallPluginCommand extends Command
|
|||||||
{
|
{
|
||||||
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
||||||
|
|
||||||
/** @var ?Plugin $plugin */
|
$plugin = Plugin::find($id);
|
||||||
$plugin = Plugin::where('id', $id)->first();
|
|
||||||
|
|
||||||
if (!$plugin) {
|
if (!$plugin) {
|
||||||
$this->error('Plugin does not exist!');
|
$this->error('Plugin does not exist!');
|
||||||
|
|||||||
@ -16,8 +16,7 @@ class UpdatePluginCommand extends Command
|
|||||||
{
|
{
|
||||||
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
$id = $this->argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray());
|
||||||
|
|
||||||
/** @var ?Plugin $plugin */
|
$plugin = Plugin::find($id);
|
||||||
$plugin = Plugin::where('id', $id)->first();
|
|
||||||
|
|
||||||
if (!$plugin) {
|
if (!$plugin) {
|
||||||
$this->error('Plugin does not exist!');
|
$this->error('Plugin does not exist!');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user