This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| return [ | |
| ... | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Autoloaded Service Providers | |
| |-------------------------------------------------------------------------- | |
| | | |
| | The service providers listed here will be automatically loaded on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Providers; | |
| use App\Services\UPS; | |
| use UPS\Client; | |
| use Illuminate\Support\ServiceProvider; | |
| class UPSServiceProvider extends ServiceProvider | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Facades; | |
| use Illuminate\Support\Facades\Facade; | |
| class UPS extends Facade { | |
| protected static function getFacadeAccessor() { return 'ups'; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Services; | |
| use App\Order; | |
| use UPS\Client; | |
| class UPS{ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Tests\Feature; | |
| use App\Cart; | |
| use App\CartItem; | |
| use App\Product; | |
| use App\User; | |
| use Tests\TestCase; | |
| use Illuminate\Foundation\Testing\WithoutMiddleware; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Model Factories | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Here you may define all of your model factories. Model factories give | |
| | you a convenient way to create models for testing and seeding your | |
| | database. Just tell the factory how a default model should look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $factory->define(\App\Product::class, function(\Faker\Generator $faker){ | |
| return [ | |
| 'title'=>$faker->word, | |
| 'description'=>$faker->paragraph, | |
| 'price'=>$faker->randomFloat(), | |
| 'available'=>$faker->boolean() | |
| ]; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Model Factories | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Here you may define all of your model factories. Model factories give | |
| | you a convenient way to create models for testing and seeding your | |
| | database. Just tell the factory how a default model should look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Product extends Model | |
| { | |
| // | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| Schema::create('users', function (Blueprint $table) { | |
| $table->increments('id'); | |
| $table->string('name'); | |
| $table->string('email')->unique(); | |
| $table->string('password'); | |
| $table->rememberToken(); | |
| $table->timestamps(); | |
| }); |