We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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?



2.7k

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



22.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.