Skip to main content

Comments & Discussion

RA
Richard A. Hoyle ✓ Link copied!

Tried to get my version of your program to work but temporality gave up and decided to try and work with yours to figure out what I am doing wrong. Having after I downloaded your GitHub repository and set it up which went ok. I try to delete a company and get the following Error.

 
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`lvdy_reservations`.`activities`, CONSTRAINT `activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`))
 
delete from `companies` where `id` = 4
 
public function destroy(Company $company)
 
{
 
$company->delete();
 
 
 
return to_route('companies.index');
 
}

How can I fix this or better yeat sence it is your code can you?

Ok yes if you delete the activities first then you can delete the company so I thank we need to disable the company delete if there are any activities available what do you thank.

N
Nerijus ✓ Link copied!

cascadeOnDelete() should work

D
Davery ✓ Link copied!

I'm getting an error on the test test_pdf_export, any ideas? I think it has something to do with the formatting, but not sure.

Failed asserting that two strings are equal.
-'attachment; filename="quasi.pdf"'
+'attachment; filename=quasi.pdf'
N
Nerijus ✓ Link copied!

Message is very clear. You expect some value but get a different one

D
Davery ✓ Link copied!

For anyone else who runs into the failing test. Update this line from the above test:

$this->assertEquals('attachment; filename="' . $activity->name .'.pdf"', $response->headers->get('Content-Disposition'));

to this:

$this->assertEquals('attachment; filename='.$activity->name.'.pdf', $response->headers->get('Content-Disposition'));

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.