This project has been archived. If you're curious, check out one of my latest courses:

If you work with JavaScript, check out the fetch use cases and JavaScript projects.

Thank you! — Jad Joubran


We'll be following the Test Driven Development process

Define the model factory


$factory->define(App\Post::class, function (Faker\Generator $faker) {
    return [
        'title' => $faker->word,
        'description' => $faker->text,

Writing the test

php artisan make:test GetAllPostsTest



namespace Tests\Feature;

use Tests\TestCase;

class GetAllPostsTest extends TestCase
    public function testGetAllPosts()
        $post = factory(\App\Post::class)->create();

            'id' => $post->id,
            'title' => $post->title,