Posts

Showing posts with the label laravel

Laravel and Mysql three tables relationship

I need to add three tables to MySql but I don't know how to organize them. My tables are : And my relations : Surfaces are enter after apartment, so I can't use surfaces floor as my apartment floor. At the moment I have apartment table and floor table with a pivot table (many to many). In Mysql, what's the best way to handle this ? And after inside laravel ? Thank for yourhelp ! Edit : my work on laravel so far (only floor table and apartment table) In Apartment.php : In Floor.php : Edit 2 : my migration so far : I can think of below kind of relationships in Laravel, I have not created the sample code although but it should help. Apartment model: Floor model: Surface model: However , it will bring more clarity to the answers if you can provide table schema or migration schema on the same question. Also, you can mention which kinds of SQL queries you are expecting and want to execute. Thanks. Hope this helps. By clicking "Post...

how to verify signed url when submiting as post via vuejs?

Image
I am using laravels signedRoutes and I have signed a route on the server and now I need to submit this route again to the server but from the client which is in javascript. Below code is what I have before I send it to the server. When I recieve this post request on the server I do "we cool!" does not print for me, which means Laravel has problem to verify the valid signature when sent as a post. I also tried attaching like this where but laravel still fails to verify that signature is valid, which it is, since it works over simple route like this but as soon as I go to post it fails. I need to use the post, since I must send password in the post and I do not wish to send it via get request. Edit: signedUrl route inside vue file: computed property make a post call to server: url that gets generated: original url that user sees in the email is: notice how 8? gets turned into 8%3 and same for rest of the special charcters. If you are wondering what I am trying to do. After user...