title: Laravel Eloquent - Model::all() method give all result including soft deletes
body: <p>When I select all records using eloquent <strong>Model::all()</strong> method it's give me soft delete record too.</p>
  
  <p>Model class</p>
  
  <pre><code>protected $table = 'tr_fl_tax_charges';
  
  protected $primaryKey = 'fl_tax_id';
  
  use SoftDeletes;
  
  protected $softDelete = true;
  
  protected $dates = ['deleted_at'];
  </code></pre>
  
  <p>Controller class</p>
  
  <p><strong>Case 1</strong></p>
  
  <pre><code>public function index()
  {
  
      $tax = Tax::all();
  
      return $tax;
  }
  </code></pre>
  
  <p>it's give me all record including soft deleted row.</p>
  
  <p><strong>Case 2</strong></p>
  
  <pre><code>public function index()
  {
  
      $tax = Tax::all()-&gt;where('deleted_at' , '=', null);
  
      return $tax;
  }
  </code></pre>
  
  <p>this case give me correct output and not including soft deleted rows but it's give me all the columns and I don't need all columns.I need only 4 columns.</p>
  
  <p><strong>Case 3</strong></p>
  
  <p>If I add column name that need in <strong>all()</strong> method it's give me soft deleted row too.</p>
  
  <pre><code>public function index()
  {
  
      $tax = Tax::all('fl_tax_id','fl_tax_type','fl_tax_name','fl_charge_type','fl_charge_rate')-&gt;where('deleted_at' , '=', null);
  
      return $tax;
  }
  </code></pre>
  
  <p><strong>Case 4</strong></p>
  
  <p>If I add one more column deleted_At in case 3 it's give me expected output.</p>
  
  <pre><code>public function index()
  {
  
      $tax = Tax::all('fl_tax_id','fl_tax_type','fl_tax_name','fl_charge_type','fl_charge_rate', 'deleted_at')-&gt;where('deleted_at' , '=', null);
  
      return $tax;
  }
  </code></pre>
  
  <p>What I want is I want only those record which is not soft deleted and from those records I want to select columns. How ?</p>
  
  <p><strong>UPDATE WITH MODEL AND CONTROLLER FILES</strong></p>
  
  <p>Tax.php (Model) - here BaseModel extends Model</p>
  
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  class Tax extends BaseModel
  
  {
  
  protected $table = 'tr_fl_tax_charges';
  
  protected $primaryKey = 'fl_tax_id';
  
  use SoftDeletes;
  
  protected $softDelete = true;
  
  //protected $fillable = ['fl_tax_type' , 'fl_tax_name' , 'fl_charge_type' , 'fl_charge_rate'];
  
  protected $guarded = [];
  
  protected $dates = ['deleted_at'];
  
  
  }
  </code></pre>
  
  <p>TaxController.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Models\Tax;
  use Illuminate\Http\Request;
  use Validator;
  
  class TaxController extends Controller
  
  {
  
  public function index()
  
  {
  
  $tax = Tax::all();
  
  return $tax;
  
  }
  </code></pre>