If you are using the $invoice outside of your if check you'll get undefined.
I will avoid storing the FULL eloquent instance of the $invoice and store just the id instead and than just get it from the model.
I would also do a redirect->with so it uses a flash session, because the way you store it now it will stay there until you override it or the session expires, which can lead to trouble.