<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Polymorphic Relations In Laravel]]></title><description><![CDATA[<p dir="auto">anyone can explain about larvel polymorphic relationship?</p>
]]></description><link>https://lankadevelopers.lk/topic/8/polymorphic-relations-in-laravel</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 13:50:09 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/8.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Nov 2018 10:23:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Polymorphic Relations In Laravel on Tue, 27 Nov 2018 10:12:43 GMT]]></title><description><![CDATA[<p dir="auto">thank you, I'll find out :smile:</p>
]]></description><link>https://lankadevelopers.lk/post/101</link><guid isPermaLink="true">https://lankadevelopers.lk/post/101</guid><dc:creator><![CDATA[fern]]></dc:creator><pubDate>Tue, 27 Nov 2018 10:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to Polymorphic Relations In Laravel on Tue, 27 Nov 2018 09:46:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/35">@fern</a> you can find it on below url..</p>
]]></description><link>https://lankadevelopers.lk/post/100</link><guid isPermaLink="true">https://lankadevelopers.lk/post/100</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Tue, 27 Nov 2018 09:46:16 GMT</pubDate></item><item><title><![CDATA[Reply to Polymorphic Relations In Laravel on Tue, 27 Nov 2018 09:22:48 GMT]]></title><description><![CDATA[<p dir="auto">thank you bro, can you post sample code snippet for model?</p>
]]></description><link>https://lankadevelopers.lk/post/99</link><guid isPermaLink="true">https://lankadevelopers.lk/post/99</guid><dc:creator><![CDATA[fern]]></dc:creator><pubDate>Tue, 27 Nov 2018 09:22:48 GMT</pubDate></item><item><title><![CDATA[Reply to Polymorphic Relations In Laravel on Tue, 27 Nov 2018 09:05:37 GMT]]></title><description><![CDATA[<pre><code>"A polymorphic relationship allows the target model to belong to more than one type of model using a single association."
</code></pre>
<p dir="auto">That means you can associate one(1) table (Model) for different situations.</p>
<p dir="auto">Ex : Facebook has comments for Images and Videos, I<strong>n the backend Facebook only has one "comments" table for both Images &amp; Videos.</strong></p>
<p dir="auto">And also this relationship can work with other relationships in Eloquent ORM</p>
<ul>
<li>One To One (Polymorphic)</li>
<li>One To Many (Polymorphic)</li>
<li>Many To Many (Polymorphic)</li>
</ul>
<p dir="auto"><a href="https://laravel.com/docs/5.7/eloquent-relationships#polymorphic-relationships" target="_blank" rel="noopener noreferrer nofollow ugc">https://laravel.com/docs/5.7/eloquent-relationships#polymorphic-relationships</a></p>
]]></description><link>https://lankadevelopers.lk/post/98</link><guid isPermaLink="true">https://lankadevelopers.lk/post/98</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Tue, 27 Nov 2018 09:05:37 GMT</pubDate></item></channel></rss>