8000 add Product model and products migration · milwad-dev/laravel-attributes@8e980b9 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 8e980b9

Browse files
committed
add Product model and products migration
1 parent 0b3b91d commit 8e980b9

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('products', function (Blueprint $table) {
17+
$table->id();
18+
$table->string('title');
19+
$table->timestamps();
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::dropIfExists('products');
31+
}
32+
};

tests/SetUp/models/Product.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Tests\SetUp\models;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Product extends Model
8+
{
9+
protected $table = 'products';
10+
protected $fillable = ['title'];
11+
}

0 commit comments

Comments
 (0)
0