I've this model Customer :
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\softDeletes;
class Customer extends Model
{
use SoftDeletes;
protected $table = 'customers';
public $timestamps = true;
protected $dates = ['deleted_at'];
protected $fillable = ['name', ...
...
What I can't understand is : When I try this :
$customer = Customer::all();
dd($customer);
I get results
and when trying this :
$customer = Customer::find(1);
dd($customer);
I get null
.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire