This file contains 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
// Yours | |
DB::table('orders')->update([ | |
[ | |
'tracking_no' => $request->input('tracking_no'), | |
'bc_no' => $request->input('bc_no'), | |
] | |
] | |
// Try this: |
This file contains 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
/** @test */ | |
public function it_can_update_the_order() | |
{ | |
$order = factory(Order::class)->create(); | |
$orderRepo = new OrderRepository($order); | |
$customer = factory(Customer::class)->create(); | |
$courier = factory(Courier::class)->create(); | |
$address = factory(Address::class)->create(); |
This file contains 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
const ctrl = this.myForm.controls['rows']; | |
ctrl.controls.forEach((field) => { | |
const col1 = parseInt(field.get('col1').value, 10); | |
const col2 = parseInt(field.get('col2').value, 10); | |
const sum = col1 + col2; | |
// How to set these values to col3? | |
// Doesn't work: field.get('col3').setValue(sum); | |
}); | |
public createForm() { |
This file contains 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\Unit\Carousels; | |
use Tests\TestCase; | |
class CarouselUnitTest extends TestCase | |
{ | |
/** @test */ | |
public function it_can_create_a_carousel() |
This file contains 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\Shop\Carousels\Repositories; | |
use App\Shop\Carousels\Carousel; | |
use App\Shop\Carousels\Exceptions\CreateCarouselErrorException; | |
use Illuminate\Database\QueryException; | |
class CarouselRepository | |
{ |
This file contains 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\Shop\Carousels; | |
use Illuminate\Database\Eloquent\Model; | |
class Carousel extends Model | |
{ | |
protected $fillable = [ | |
'title', |
This file contains 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\Unit\Carousels; | |
use App\Shop\Carousels\Carousel; | |
use App\Shop\Carousels\Repositories\CarouselRepository; | |
use Tests\TestCase; | |
class CarouselUnitTest extends TestCase | |
{ |
This file contains 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 | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateCarouselTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains 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\Unit\Carousels; | |
use Tests\TestCase; | |
class CarouselUnitTest extends TestCase | |
{ | |
/** @test */ | |
public function it_can_show_the_carousel() |
This file contains 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. | |
| |
OlderNewer