diff --git a/app/Http/Controllers/ItemController.php b/app/Http/Controllers/ItemController.php new file mode 100644 index 0000000..c8d9eda --- /dev/null +++ b/app/Http/Controllers/ItemController.php @@ -0,0 +1,23 @@ +where([ + ['productID', $productID], + ['usedBy', ''], + ]); + } + +} diff --git a/app/Product.php b/app/Product.php new file mode 100644 index 0000000..8dee5b2 --- /dev/null +++ b/app/Product.php @@ -0,0 +1,10 @@ +increments('id'); + $table->string('name'); + $table->integer('adminID'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('products'); + } +} diff --git a/database/migrations/2018_09_08_192152_create_items_table.php b/database/migrations/2018_09_08_192152_create_items_table.php new file mode 100644 index 0000000..4b53636 --- /dev/null +++ b/database/migrations/2018_09_08_192152_create_items_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->string('name'); + $table->integer('productID'); + $table->integer('usedBy'); + $table->dateTime('usedSince'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('items'); + } +} diff --git a/readme.md b/readme.md index 32a10c9..69592a9 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Cada usuário, identificado por e-mail, pode ter outros amigos usuário(nome, email) product[site/software](nome, admin) -userPerProduct(productID, userID) +productUsers(productID, userID) item[licença](nome, productID, usedBy, usedSince) waiting(userID, itemID, waitingSince) diff --git a/resources/views/item.blade.php b/resources/views/item.blade.php new file mode 100644 index 0000000..dbf1c00 --- /dev/null +++ b/resources/views/item.blade.php @@ -0,0 +1,7 @@ + +