Payment
We'll now create the Payment
model, which will be very simple.
Let's then create a relation between Order
and Payment
. An order
may or may not have a payment
, and a payment
always belongs to an order
. Therefore, we have a one-to-one relation. Lastly, we want that an order
is deleted together with its payment
.
So, in the Order
model we should have
And in Payment
Then, let's generate and run its migration
And now, create the payments resource. Remember to choose no to CRUD entry points.
Commit - Creating payment model
Last updated