<br />
<b>Warning</b>:  The magic method SFML_Singleton::__wakeup() must have public visibility in <b>/home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php</b> on line <b>72</b><br />
{"id":250,"date":"2018-05-03T08:47:51","date_gmt":"2018-05-03T14:47:51","guid":{"rendered":"http:\/\/www.munderwood.ca\/?p=250"},"modified":"2018-05-03T08:47:51","modified_gmt":"2018-05-03T14:47:51","slug":"getting-a-faker-instance-in-laravels-tinker-environment","status":"publish","type":"post","link":"https:\/\/www.munderwood.ca\/index.php\/2018\/05\/03\/getting-a-faker-instance-in-laravels-tinker-environment\/","title":{"rendered":"Getting a Faker instance in Laravel&#8217;s tinker environment"},"content":{"rendered":"<p>I sometimes find that it would be useful to use\u00a0<a href=\"https:\/\/laravel.com\/docs\/5.6\/artisan#introduction\"><span class=\"lang:default decode:true crayon-inline\">artisan tinker<\/span><\/a>\u00a0to play with the sorts of data that <a href=\"https:\/\/github.com\/fzaninotto\/Faker\">Faker<\/a> will generate in a <a href=\"https:\/\/laravel.com\/docs\/5.6\/database-testing#writing-factories\">Laravel factory<\/a>. Unfortunately I don&#8217;t do it often enough to always remember the correct way to do it, since the obvious\u00a0<span class=\"lang:php decode:true  crayon-inline \">new Faker\\Generator<\/span>\u00a0doesn&#8217;t work. So for future reference, what you need is:<\/p>\n<pre class=\"lang:default decode:true\">&gt;&gt;&gt; $faker = Faker\\Factory::create();<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I sometimes find that it would be useful to use\u00a0artisan tinker\u00a0to play with the sorts of data that Faker will generate in a Laravel factory. Unfortunately I don&#8217;t do it often enough to always remember the correct way to do it, since the obvious\u00a0new Faker\\Generator\u00a0doesn&#8217;t work. So for future reference, what you need is: &gt;&gt;&gt; &#8230; <span class=\"more\"><a class=\"more-link\" href=\"https:\/\/www.munderwood.ca\/index.php\/2018\/05\/03\/getting-a-faker-instance-in-laravels-tinker-environment\/\">[Read more&#8230;]<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[4,5],"_links":{"self":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/250"}],"collection":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":3,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/posts\/250\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.munderwood.ca\/index.php\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}