Closed tammytee closed 1 year ago
I'm not sure if I like the quiet() helper since there's a createOneQuietly() and createQuietly() in Laravel.
@techenby I agree. I only created this helper because it didn't seem that you can apply the states from model factories using the methods Laravel provides. Unless there's a way to do it that you can share?
Went ahead and removed the quiet
macro I created for model factories. Must have placed createQuietly
in the wrong order when attempting this before.
Summary
This PR allows renewing an expired resource inside the Nova admin dashboard. It also adds the ability to filter the
Resource
s resource to view either expired or active resources only.In order to view the "Renew Resource" action, the resource must:
To renew a resource, select the "Renew Resource" action:
Resource Expiration Date
A new migration was added to set the default value for the
expiration_date
column toNULL
instead ofnow()->addMonths(6)
, as done in a previous migration. Using the Carbon helper inside the migration means every resource created thatcan_expire
has a 6-monthexpiration_date
from the day the migration was created. The new migration fixes this.In addition to this change, closures for the
creating
andupdating
model events are registered on theResource
model to automatically set the resource'sexpiration_date
based on if the resourcecan_expire
.Screenshots