public function photos(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(Photo::class, 'product_id' , 'id');
}
$product = Product::create([
'title' => 'custom title'
]);
$product->photos-> ?
<template>
...
<Items :i_files="files" :i_items="temporaryFiles" :isAllUploading="isAllUploading" :uploading="uploading" />
...
</template>
<script setup>
...
const props = defineProps({
i_items: Array,
i_files: Array,
isAllUploading: Function,
uploading: Boolean,
})
console.log(props);
function destroy(index, file, type){
URL.revokeObjectURL(file);
props.i_items.splice(index, 1);
props.i_files.splice(index, 1);
if(!props.isAllUploading()) props.uploading = false;
}
...
</script>
export default {
destroy: function(index, file, type){
URL.revokeObjectURL(file);
this.items.splice(index, 1);
this.files.splice(index, 1);
if(!this.$parent.isAllUploading()) this.$parent.$data.uploading = false;
},
}
<script setup>
это не работает $('.scroll_link').on('click', function (e) {
e.preventDefault();
let destination = $(this.hash);
if (destination.offset() === undefined){
console.log($(this).attr('href'));
window.location.href = $(this).attr('href');
return;
}
let scrollPosition = destination.offset().top-180;
let animationDuration = 500;
$('html, body').animate({
scrollTop: scrollPosition
}, animationDuration);
});
"../../../img/page/url_id_page_/dd2b0a2c5925e4f55da1992456eb9ef8.webp"