Level 5
If you try to show the other variables like 'activity', is it visible in the input text?
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
migration file
class CreateLogbooksTable extends Migration
{
public function up()
{
Schema::create('logbooks', function (Blueprint $table) {
$table->id();
// relational
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->foreignId('proposal_id')->constrained('proposals')->cascadeOnDelete();
// detail
$table->date('date');
$table->text('activity');
$table->integer('percentage');
$table->text('file')->nullable();
$table->timestamps();
});
}
}
model
class Logbook extends Model
{
use HasFactory;
protected $guarded = ['id'];
protected $dates = ['date']; // problem in here
const LOGBOOK_PATH = 'public/data/logbooks';
public function user()
{
return $this->belongsTo(User::class);
}
public function proposal()
{
return $this->belongsTo(User::class);
}
}
edit.blade.php
<input type="date" name="date" value="{{ old('date') ?? $logbook->date }}">
@mhmmdva Try this:
<input type="date" name="date" value="{{ old('date') ?? $logbook->date->format('Y-m-d') }}">
Please or to participate in this conversation.