Initial Commit
This commit is contained in:
commit
9b22323711
36 changed files with 7164 additions and 0 deletions
36
app/Console/Commands/AddWordCommand.php
Normal file
36
app/Console/Commands/AddWordCommand.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in a new issue