mirror of
https://github.com/10h30/MoveMate.git
synced 2026-07-14 04:06:23 +09:00
Add Session Controller and UserRegisterController to manage login and register
This commit is contained in:
+14
-2
@@ -10,9 +10,21 @@ class Task extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $attributes = [
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($task) {
|
||||
if (is_null($task->completed)) {
|
||||
$task->completed = false; // Ensure completed is false when creating a new task
|
||||
}
|
||||
$task->user_id = Auth::id(); // Set user_id automatically
|
||||
});
|
||||
}
|
||||
|
||||
/* protected $attributes = [
|
||||
'completed' => false, // Set default value for completed
|
||||
];
|
||||
]; */
|
||||
|
||||
|
||||
public function user() {
|
||||
|
||||
Reference in New Issue
Block a user