<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mostafa Jamali</title>
    <description>The latest articles on DEV Community by Mostafa Jamali (@rainbow1997).</description>
    <link>https://dev.to/rainbow1997</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F744771%2Fb7b46cf4-c46c-4a82-96b6-e2b2ab4ee111.png</url>
      <title>DEV Community: Mostafa Jamali</title>
      <link>https://dev.to/rainbow1997</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rainbow1997"/>
    <language>en</language>
    <item>
      <title>implements of the OOP concepts in Laravel</title>
      <dc:creator>Mostafa Jamali</dc:creator>
      <pubDate>Thu, 04 Nov 2021 12:08:54 +0000</pubDate>
      <link>https://dev.to/rainbow1997/implements-of-the-oop-concepts-in-laravel-7fc</link>
      <guid>https://dev.to/rainbow1997/implements-of-the-oop-concepts-in-laravel-7fc</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Hello everyone, I hope you are healthy. Usually, I've confused about how to follow OOP rules as using Laravel! for example how to follow SOLID rules with the framework.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For example, I want to build a simple marketplace for a company and I follow this method.&lt;br&gt;
   For example for the invoicement part :&lt;br&gt;
1- First, I created an interface for it.&lt;br&gt;
Code:&lt;br&gt;
InvoiceIf.php-&amp;gt;&lt;br&gt;
&amp;lt;?php&lt;br&gt;
namespace App\Classes\Interfaces;&lt;br&gt;
interface InvoiceIf&lt;br&gt;
{&lt;br&gt;
    public function customer();&lt;br&gt;
    public function sellerUsers();&lt;br&gt;
    public function products();&lt;br&gt;
    public function prices();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Then, I've created a Eloquent Model like:&lt;br&gt;
Invoice.php&lt;br&gt;
&amp;lt;?php&lt;br&gt;
namespace App\Classes;&lt;br&gt;
use Illuminate\Database\Eloquent\Model;&lt;br&gt;
use App\Classes\SellerUser;&lt;br&gt;
class Invoice extends Model implements InvoiceIf&lt;br&gt;
{&lt;br&gt;
    final public function customer()&lt;br&gt;
    {&lt;br&gt;
        return $this-&amp;gt;hasOne(Customer::class);&lt;br&gt;
    }&lt;br&gt;
    final public function sellerUsers()&lt;br&gt;
    {&lt;br&gt;
        return $this-&amp;gt;hasMany(SellerUser::class);&lt;br&gt;
    }&lt;br&gt;
    final public function products()&lt;br&gt;
    {&lt;br&gt;
        return $this-&amp;gt;hasMany(Product::class);&lt;br&gt;
    }&lt;br&gt;
    final public function prices()&lt;br&gt;
    {&lt;br&gt;
        return $this-&amp;gt;hasMany(Price::class);&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
Third, I create a Controller to handle user requirements. &lt;br&gt;
but in this time, this method that I've followed it is true or not?&lt;br&gt;
please help me...&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>oop</category>
      <category>php</category>
    </item>
  </channel>
</rss>
