Skip to content

Instantly share code, notes, and snippets.

View tonyfrenzy's full-sized avatar
💭
Upskilling 💻

tony tonyfrenzy

💭
Upskilling 💻
View GitHub Profile
@tonyfrenzy
tonyfrenzy / morphToMany()_test.php
Created June 13, 2020 20:10
morphToMany() Many-to-Many Polymorphic Relationship Test (Video-tag) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
// ...
use App\Video;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
@tonyfrenzy
tonyfrenzy / morphedByMany_test.php
Last active June 14, 2020 22:48
morphedByMany() Polymorphic Relationship Test (Tag-Posts/Videos) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
// ...
use App\User;
use App\Post;
use App\Tag;
use App\Video;
use Tests\TestCase;
@tonyfrenzy
tonyfrenzy / morphMany_poly_test.php
Created September 28, 2019 22:57
morphMany() One-to-Many Polymorphic Relationship Test (Comment, Video, Post) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Comment;
use App\Country;
use App\Post;
use App\Supplier;
use App\User;
use App\Video;
use Tests\TestCase;
@tonyfrenzy
tonyfrenzy / morphTo_poly_test.php
Last active September 28, 2019 22:58
morphTo() One-to-Many Polymorphic Relationship Test (Comment, Video, Post) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Comment;
use App\Country;
use App\Post;
use App\Supplier;
use App\User;
use App\Video;
use Illuminate\Foundation\Testing\RefreshDatabase;
@tonyfrenzy
tonyfrenzy / morphOne_test.php
Created September 28, 2019 15:22
morphOne() Polymorphic Relationship Test (User-Image) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Country;
use App\Image;
use App\Post;
use App\Supplier;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
@tonyfrenzy
tonyfrenzy / morphTo_test.php
Last active September 28, 2019 15:16
morphTo() Polymorphic Relationship Test (User-Image) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Country;
use App\Image;
use App\Post;
use App\Supplier;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
@tonyfrenzy
tonyfrenzy / hasManyThrough_test.php
Created September 28, 2019 13:27
hasManyThrough() Relationship Test (Country-Post-User) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Country;
use App\Post;
use App\Supplier;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Schema;
@tonyfrenzy
tonyfrenzy / hasOneThrough_test.php
Created September 28, 2019 08:49
hasOneThrough() Relationship Test (Supplier-History-User) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\History;
use App\Supplier;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;
@tonyfrenzy
tonyfrenzy / belongsToMany_test_2.php
Last active September 28, 2019 08:53
belongsToMany() Relationship Test 2 (User-Role) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Role;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;
@tonyfrenzy
tonyfrenzy / belongsToMany_test_1.php
Last active September 28, 2019 08:53
belongsToMany() Relationship Test I (User-Role) - Testing Model Relationships in Laravel
<?php
namespace Tests\Unit;
use App\Role;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;