title: How to assign key as well as value to model object in Laravel?
body: <p>I am doing project in Laravel. I want to assign some fields whose column keys as well as values are same in multiple tables. Like I have common fields like created_by,updated_by,status fields as common in almost every table.</p>
  
  <p>I have create array of these key values,</p>
  
  <pre><code>$common_data     = ['status' =&gt; Constants::ACTIVE,'created_by' =&gt; 1,'updated_by' =&gt; 1];
  </code></pre>
  
  <p>Every time when I create new object of model I have to manually assign them to this object like,</p>
  
  <pre><code>$intake = new Intake($data);
  $intake-&gt;name = 'test;
  $intake-&gt;email = 'test@gmail.com;
  $intake-&gt;status = Constants::ACTIVE;
  $intake-&gt;created_by = 1;
  $intake-&gt;updated_by = 1;
  </code></pre>
  
  <p>and save() will be somewhere else.</p>
  
  <p>So instead of having this, Is there any way to add these common fields to the object. Like some push operation or something else. </p>