Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Laravel - Phalcon

Hi

https://laravel.com/docs/5.3/eloquent-relationships#updating-many-to-many-relationships

phalcon has "attach" ... "detach" .... "sync" method ? help me via example Thank you

No it doesn't have.

edited Jan '17

What is exactly you want to achieve? Even though Phalcon does not have those exact methods, there are other ways to get the same result...

Isn't there PSR which defines interoperability at ORM level between frameworks?

Isn't there PSR which defines interoperability at ORM level between frameworks?

i want for startup project use laravel but that low speed phalcon speed better but Facilities is little asp.net mvc is best choice .... Thanks all



8.7k
Accepted
answer

What is exactly you want to achieve? Even though Phalcon does not have those exact methods, there are other ways to get the same result...

I had this issue come up before. In Laravel with the attach you can have 3 tables, and the middle pivot table with extra columns, and using the attach you can set those columns with data. Example, user table, phone table, and then a userphone table with allowsms column or primaryphone and with the attach

$user->phones()->attach($provider, ['allowsms' => 'Y', 'primaryphone'=>'Y']);

In the many to many scenario in Phalcon that middle table is best left to be the join columns only with no other reference. It is a nice feature.