$table->unsignedBigInteger('user_id');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
public function user()
{
return $this->belongsTo(User::class);
}
$user = User::find(1);
$firstUserAvatar = $user->avatar->img;
<input type="number" name="quantity" min="1" max="5">
if(typeof(input.value) == 'number'){
alert('вы прошли');
}else if(typeof(input.value) == 'string'){
alert('вводить можно только буквы');
}
function deepEqual(obj1, obj2) {
if (typeof obj1 !== "object" || typeof obj2 !== "object") {
return false;
}
if (obj1 === undefined || obj2 === undefined) {
return false;
}
if (obj1 === null || obj2 === null) {
return false;
}
let obj1Keys = Object.keys(obj1);
let obj2Keys = Object.keys(obj2);
if (obj1Keys.length !== obj2Keys.length) {
return false;
}
for (let i = 0; i < obj1Keys.length; i++) {
if (obj2Keys.includes(obj1Keys[i]) === false) {
return false;
}
}
for (let i = 0; i < obj1Keys.length; i++) {
if (typeof obj1[obj1Keys[i]] === "object") {
return deepEqual(obj1[obj1Keys[i]], obj2[obj1Keys[i]]);
}
if (obj1[obj1Keys[i]] !== obj2[obj2Keys[i]]) {
return false;
}
}
return true;
}