I am struggling with the following
I have a table called plates
{
"id": 1,
"plate_container_id": 1,
"plate_container_slot": 1,
"deleted_at": null,
"created_at": "2015-10-21 18:42:26",
"updated_at": "2015-10-21 18:57:27"
}
And I have table called platecontainers
{
"id": 1,
"name": "Prof. Carroll Smitham PhD",
"number_of_slots": 7,
"description": "Asperiores reiciendis",
"created_at": "2015-10-21 18:42:25",
"updated_at": "2015-10-21 18:42:25"
}
What I want is -- When he user selects a platecontainer
the number_of_slots
are compared with the one in plates
table (which is plate_container_slot
) and checks which slots
are already occupied (or taken) by any other plates
. If the slot
is taken, the user gets to see those as grayed out, otherwise they are available to use.
Now I am using Angularjs and Laravel 5. Would someone please tell me what is the best way to achieve this? And how to do it? I am little confused about it.