Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72

Warning: Cannot modify header information - headers already sent by (output started at /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php:72) in /home/public/wp-includes/feed-rss2.php on line 8
snippets – Thoughts, etc. https://www.munderwood.ca Tracking the occasional random walk Thu, 03 May 2018 14:47:51 +0000 en-CA hourly 1 https://wordpress.org/?v=5.7.2 https://www.munderwood.ca/wp-content/uploads/2016/03/photo-150x150.jpg snippets – Thoughts, etc. https://www.munderwood.ca 32 32 Getting a Faker instance in Laravel’s tinker environment https://www.munderwood.ca/index.php/2018/05/03/getting-a-faker-instance-in-laravels-tinker-environment/ https://www.munderwood.ca/index.php/2018/05/03/getting-a-faker-instance-in-laravels-tinker-environment/#comments Thu, 03 May 2018 14:47:51 +0000 http://www.munderwood.ca/?p=250 I sometimes find that it would be useful to use  artisan tinker to play with the sorts of data that Faker will generate in a Laravel factory. Unfortunately I don’t do it often enough to always remember the correct way to do it, since the obvious  new Faker\Generator doesn’t work. So for future reference, what you need is:

>>> $faker = Faker\Factory::create();

 

]]>
https://www.munderwood.ca/index.php/2018/05/03/getting-a-faker-instance-in-laravels-tinker-environment/feed/ 3