Skip to content

Instantly share code, notes, and snippets.

@mdmuzammalhoq
Last active November 7, 2019 03:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdmuzammalhoq/bf78dd9003c411c415b20e185e6a8db2 to your computer and use it in GitHub Desktop.
Save mdmuzammalhoq/bf78dd9003c411c415b20e185e6a8db2 to your computer and use it in GitHub Desktop.
php artisan ti
factory(App\User::class, 200)->create()
***************************************************************
$q = App\Question::first();
$q->answers()->save(factory(App\Answer::class)->make());
$a = App\Answer::find(1);
$a->votes_count = 7
$a->save();
********************************************************************
$answer = App\Answer::find(8)
$answer = App\Answer::find(22)
$question = $answer->question
$question->best_answer_id = $answer->id
$question->save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment