I have these two functions.When I try to insert data I get this error
Column not found: 1054 Unknown column 'updated_at'
So it keeps searching for 'created at' and 'updated at' tables, but I've got rid of it before and replaced it with 'joined' and 'leaved'. How to fix it?
In BroadcastServiceProvider
Broadcast::channel('chat', function ($user) {
$ip = Request::ip();
$time = now();
if (auth()->check() && !session()->has('name')) {
UserInfo::storeUser();
session()->put('name',$user->name);
return [
'id' => $user->id,
'ip' => $ip,
'name' => $user->name,
'joined' => $time,
];
}
});
Schema
Schema::create('user_info', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('ip');
$table->string('joined');
$table->string('leaved');
});
In LoginController
public function logout() {
auth()->logout();
session()->forget('name');
session()->put('leaved',now());
return redirect('/');
}