Archived
1
0
Fork 0

Initial Commit

This commit is contained in:
Henrik Hautakoski 2020-10-03 16:07:18 +02:00
commit 9b22323711
36 changed files with 7164 additions and 0 deletions

View file

View 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();
}
}

29
app/Console/Kernel.php Normal file
View file

@ -0,0 +1,29 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\App\Console\Commands\AddWordCommand::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//
}
}