fix: schema so that created_at uses current timestamp
This commit is contained in:
parent
59b74a6905
commit
82d61e757f
@ -17,6 +17,7 @@
|
|||||||
* @property \Illuminate\Support\Carbon $created_at
|
* @property \Illuminate\Support\Carbon $created_at
|
||||||
* @property-read \App\Models\Inbox|null $inbox
|
* @property-read \App\Models\Inbox|null $inbox
|
||||||
* @property-read \App\Models\User|null $user
|
* @property-read \App\Models\User|null $user
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message query()
|
||||||
@ -29,15 +30,19 @@
|
|||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereMessage($value)
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereMessage($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereReadAt($value)
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereReadAt($value)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereUserId($value)
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Message whereUserId($value)
|
||||||
|
*
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
*/
|
*/
|
||||||
class Message extends Model
|
class Message extends Model
|
||||||
{
|
{
|
||||||
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'inbox_id', 'user_id', 'message',
|
'inbox_id', 'user_id', 'message',
|
||||||
'read_at', 'deleted_at', 'failed_at',
|
'read_at', 'deleted_at', 'failed_at',
|
||||||
'created_at', 'delivered_at'
|
'created_at', 'delivered_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function inbox(): BelongsTo
|
public function inbox(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Inbox::class);
|
return $this->belongsTo(Inbox::class);
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public function up(): void
|
|||||||
$table->time('delivered_at')->nullable();
|
$table->time('delivered_at')->nullable();
|
||||||
$table->time('deleted_at')->nullable();
|
$table->time('deleted_at')->nullable();
|
||||||
$table->time('failed_at')->nullable();
|
$table->time('failed_at')->nullable();
|
||||||
$table->time('created_at')->useCurrent()->index();
|
$table->timestamp('created_at')->useCurrent()->index();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user