Level 7
this is. my Laravel controller:
public function single(Request $request, $id)
{
$artworks = Gallery::findOrFail($id);
return view('single', compact('artworks'));
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I don't think I'm getting ID from my URL properly?! I'm getting: Here is the error: Error: Request failed with status code 404
Please help?
<script>
export default {
data: function() {
return {
artwork: {}
}
},
mounted() {
this.loadArtwork(id)
},
methods: {
loadArtwork: function(id) {
//load API
axios.get('https://melvynbiddulph.co.uk/api/artwork/'+id)
.then((response) => {
this.artwork = response.data
console.log('here we go: ', this.artwork)
})
.catch( function (error) {
console.log(console.log("Here is the error: ",error))
})
//assign this.artwork
}
}
}
</script>
Please or to participate in this conversation.