Squashed commit of the following:

commit 94b13846d90c02041f56b21111709da91cd40726
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Oct 22 15:51:47 2017 +0100

    Remove un-needed use statement

commit c370d83766fb10a100f780124bdcfc2694208140
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Oct 22 15:44:50 2017 +0100

    use fillable instead of guarded, drop dates transform

commit dcf620c168f75d6c9860f5149adebfaceb9d772f
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Oct 22 15:42:41 2017 +0100

    Given we are adding a property for contacts, we need to invoke Laravel’s
    own model __construct() method.

commit 0cba9301c3175e60bf1c3b0ada36c79a3c33c72c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Oct 22 15:37:19 2017 +0100

    Given change in mass-assignment protection, change how we populate database

commit 7d09d174153ca99c0975d70fbccdc340d437227c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Sun Oct 22 10:38:51 2017 +0100

    Use a property to hold parsed contact info

commit 25b05f8592ee282da5d82227b9873b523e9955d3
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Oct 20 17:19:44 2017 +0100

    First attempts at reducing eloquent calls
This commit is contained in:
Jonny Barnes 2017-10-22 16:16:13 +01:00
parent 52f8990e2c
commit 1ba1b40588
4 changed files with 86 additions and 70 deletions

View file

@ -5,7 +5,5 @@ use Faker\Generator as Faker;
$factory->define(App\Note::class, function (Faker $faker) {
return [
'note' => $faker->paragraph,
'tweet_id' => $faker->randomNumber(9),
'facebook_url' => 'https://facebook.com/' . $faker->randomNumber(9),
];
});

View file

@ -15,8 +15,8 @@ class NotesTableSeeder extends Seeder
sleep(1);
$noteWithPlace = App\Note::create([
'note' => 'Having a #beer at the local. 🍺',
'tweet_id' => '123456789',
]);
$noteWithPlace->tweet_id = '123456789';
$place = App\Place::find(1);
$noteWithPlace->place()->associate($place);
$noteWithPlace->save();
@ -43,15 +43,17 @@ class NotesTableSeeder extends Seeder
}
$noteWithCoords = App\Note::create([
'note' => 'Note from somehwere',
'location' => '53.499,-2.379'
]);
$noteWithCoords->location = '53.499,-2.379';
$noteWithCoords->save();
sleep(1);
$noteSyndicated = App\Note::create([
'note' => 'This note has all the syndication targets',
'tweet_id' => '123456',
'facebook_url' => 'https://www.facebook.com/post/12345789',
'swarm_url' => 'https://www.swarmapp.com/checking/123456789',
'instagram_url' => 'https://www.instagra.com/p/aWsEd123Jh',
]);
$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();
}
}