Upgrade to Laravel 8
This commit is contained in:
parent
1ad58f10c5
commit
57186c3e2e
27 changed files with 945 additions and 1003 deletions
|
@ -1,58 +0,0 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Article;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ArticlesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$now = Carbon::now()->subMonth();
|
||||
$articleFirst = Article::create([
|
||||
'title' => 'My New Blog',
|
||||
'main' => 'This is *my* new blog. It uses `Markdown`.',
|
||||
'published' => 1,
|
||||
'created_at' => $now,
|
||||
]);
|
||||
DB::table('articles')
|
||||
->where('id', $articleFirst->id)
|
||||
->update(['updated_at' => $now->toDateTimeString()]);
|
||||
|
||||
$now = Carbon::now()->subHours(2)->subMinutes(25);
|
||||
$articleWithCode = <<<EOF
|
||||
I wrote some code.
|
||||
|
||||
I liked writing this:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
class Foo
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
echo 'Foo class constructed';
|
||||
}
|
||||
}
|
||||
```
|
||||
EOF;
|
||||
$articleSecond = Article::create([
|
||||
'title' => 'Some code I did',
|
||||
'main' => $articleWithCode,
|
||||
'published' => 1,
|
||||
'created_at' => $now,
|
||||
]);
|
||||
DB::table('articles')
|
||||
->where('id', $articleSecond->id)
|
||||
->update(['updated_at' => $now->toDateTimeString()]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue