1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
sexelleryoga/app/Console/Commands/AddWordCommand.php
2020-10-03 16:07:18 +02:00

36 lines
687 B
PHP

<?php
namespace App\Console\Commands;
use App\Models\Word;
use Illuminate\Console\Command;
class AddWordCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'addword {word} {type}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Add a word to the database';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$row = new Word;
$row->value = $this->argument('word');
$row->type = $this->argument('type');
$row->save();
}
}