jonnybarnes.uk/database/seeds/NotesTableSeeder.php
Jonny Barnes 427b79f278 Improve syntax highlighting of code
Squashed commit of the following:

commit eb55e94ed89a1b8ccd1db10a36efd28d8896f316
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Jan 24 18:45:00 2019 +0000

    Remove un-needed use statments, fix tests now we have 2 articles

commit f1c12c1b43d071fe0484407a9692ee4184542437
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 23 19:39:56 2019 +0000

    Remove prism files

commit 3a1d12d9181600f661593c662dbc18d152413b28
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 23 19:39:24 2019 +0000

    Use the new css file in the search page

commit 119b6b5163c217a15770004a45b07bacdfb766f0
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Jan 23 19:36:14 2019 +0000

    Recompress assets

commit afae245d0211dd31fcc131cecb0fab4084895612
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 20 19:33:56 2019 +0000

    Style codeblocks in articles as well

commit 53be0a2023755c2f16ba1560d88f9c66675b581d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 20 19:23:25 2019 +0000

    Styled codeblocks are now on the notes pages

commit 818add06f349874501cc44baf332dc63dfdcfab1
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 20 19:08:56 2019 +0000

    Install spatie’s commonmark highlighter, use it for notes

commit fb69d98b2bd3bb56540854fe16200c027e5ef6b2
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 20 18:54:27 2019 +0000

    Remove links to prism code in the notes pages

commit dc89fcd4711b25e8407be9b25b58cd4cd1e9980e
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Jan 20 18:54:11 2019 +0000

    Add a note to the seeder which has a code block
2019-01-24 19:19:45 +00:00

123 lines
4.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
use Illuminate\Database\Seeder;
use App\Models\{Media, Note, Place};
class NotesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
factory(Note::class, 10)->create();
sleep(1);
$noteTwitterReply = Note::create([
'note' => 'What does this even mean?',
'in_reply_to' => 'https://twitter.com/realDonaldTrump/status/933662564587855877',
]);
sleep(1);
$noteWithPlace = Note::create([
'note' => 'Having a #beer at the local. 🍺',
]);
$noteWithPlace->tweet_id = '123456789';
$place = Place::find(1);
$noteWithPlace->place()->associate($place);
$noteWithPlace->save();
sleep(1);
$noteWithPlaceTwo = Note::create([
'note' => 'Its really good',
]);
$place = Place::find(1);
$noteWithPlaceTwo->place()->associate($place);
$noteWithPlaceTwo->save();
sleep(1);
$noteWithContact = Note::create([
'note' => 'Hi @tantek'
]);
sleep(1);
$noteWithContactPlusPic = Note::create([
'note' => 'Hi @aaron',
'client_id' => 'https://jbl5.dev/notes/new'
]);
sleep(1);
$noteWithoutContact = Note::create([
'note' => 'Hi @bob',
'client_id' => 'https://quill.p3k.io'
]);
sleep(1);
//copy aarons profile pic in place
$spl = new SplFileInfo(public_path() . '/assets/profile-images/aaronparecki.com');
if ($spl->isDir() === false) {
mkdir(public_path() . '/assets/profile-images/aaronparecki.com', 0755);
copy(base_path() . '/tests/aaron.png', public_path() . '/assets/profile-images/aaronparecki.com/image');
}
$noteWithCoords = Note::create([
'note' => 'Note from a town',
]);
$noteWithCoords->location = '53.499,-2.379';
$noteWithCoords->save();
sleep(1);
$noteWithCoords2 = Note::create([
'note' => 'Note from a city',
]);
$noteWithCoords2->location = '53.9026894,-2.42250444118781';
$noteWithCoords2->save();
sleep(1);
$noteWithCoords3 = Note::create([
'note' => 'Note from a county',
]);
$noteWithCoords3->location = '57.5066357,-5.0038367';
$noteWithCoords3->save();
sleep(1);
$noteWithCoords4 = Note::create([
'note' => 'Note from a country',
]);
$noteWithCoords4->location = '63.000147,-136.002502';
$noteWithCoords4->save();
sleep(1);
$noteSyndicated = Note::create([
'note' => 'This note has all the syndication targets',
]);
$noteSyndicated->tweet_id = '123456';
$noteSyndicated->facebook_url = 'https://www.facebook.com/post/12345789';
$noteSyndicated->swarm_url = 'https://www.swarmapp.com/checking/123456789';
$noteSyndicated->instagram_url = 'https://www.instagram.com/p/aWsEd123Jh';
$noteSyndicated->save();
sleep(1);
$noteWithTextLinkandEmoji = Note::create([
'note' => 'I love https://duckduckgo.com 💕' // theres a two-heart emoji at the end of this
]);
sleep(1);
$noteJustCheckin = new Note();
$place = Place::find(1);
$noteJustCheckin->place()->associate($place);
$noteJustCheckin->save();
sleep(1);
$media = new Media();
$media->path = 'media/f1bc8faa-1a8f-45b8-a9b1-57282fa73f87.jpg';
$media->type = 'image';
$media->image_widths = '3648';
$media->save();
$noteWithOnlyImage = new Note();
$noteWithOnlyImage->save();
$noteWithOnlyImage->media()->save($media);
sleep(1);
$noteCapitalHashtag = Note::create([
'note' => 'A #TwoWord hashtag',
]);
sleep(1);
$noteWithCodeContent = <<<EOF
A note with some code:
```php
<?php
echo 'Hello World';
EOF;
$noteWithCode = Note::create([
'note' => $noteWithCodeContent,
]);
}
}