77 - Stubbing the Interface

This commit is contained in:
Adam Wathan
2017-03-13 12:31:53 -04:00
parent 65c1f9a152
commit bf0cba1f77
3 changed files with 15 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ class Order extends Model
public static function forTickets($tickets, $email, $amount)
{
$order = self::create([
'confirmation_number' => app(OrderConfirmationNumberGenerator::class)->generate(),
'email' => $email,
'amount' => $amount,
]);

View File

@@ -0,0 +1,8 @@
<?php
namespace App;
interface OrderConfirmationNumberGenerator
{
public function generate();
}