laravel error page code example
Example 1: nuxt error page
// layouts/error.vue
<template>
<div class="nuxt-error">
<component :is="errorPage" :error="error" />
</div>
</template>
<script>
import error404 from '~/components/error/404.vue';
import error500 from '~/components/error/500.vue';
export default {
name: 'nuxt-error',
layout: 'default',
props: {
error: {
type: Object,
default: () => {},
},
},
computed: {
errorPage() {
if (this.error.statusCode === 404) {
return error404;
}
return error500;
},
};
</script>
Example 2: laravel custom error page
php artisan vendor:publish --tag=laravel-errors