I am renaming the created_at
and updated
columns to createdAt
and updatedAt
respectively but it does not work.
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MyModel extends Model
{
const CREATED_AT = 'createdAt';
const UPDATED_AT = 'updatedAt';
}
And this is how I get the resources:
public function index()
{
return response(MyModel::all());
}
Using PHP Lumen 5.8
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire