How to use the laravel-nova.Minimum function in laravel-nova

To help you get started, we’ve selected a few laravel-nova examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmitrybubyakin / nova-medialibrary-field / resources / js / components / Medialibrary / Resource / Request.vue View on Github external
async created () {
        this.$emit('started')

        try {
            this.response = await Minimum(this.request(), 200)
        } catch (error) {
            this.$emit('failed', error)
        }

        this.$emit('finished')
    },
github swisnl / laravel-nova-mirror / resources / js / components / ImageLoader.vue View on Github external
mounted() {
        Minimum(
            Nova.request().get(this.src, {
                responseType: 'blob',
            })
        )
            .then(({ headers, data }) => {
                const blob = new Blob([data], { type: headers['content-type'] })
                let newImage = new Image()
                newImage.src = window.URL.createObjectURL(blob)
                newImage.className = 'block w-full'
                newImage.draggable = false
                this.$refs.card.$el.appendChild(newImage)
                this.loading = false
            })
            .catch(error => {
                this.missing = true
                this.$emit('missing', true)
github swisnl / laravel-nova-mirror / resources / js / views / Detail.vue View on Github external
getResource() {
            this.resource = null

            return Minimum(
                Nova.request().get('/nova-api/' + this.resourceName + '/' + this.resourceId)
            )
                .then(({ data: { panels, resource } }) => {
                    this.panels = panels
                    this.resource = resource
                    this.loading = false
                })
                .catch(error => {
                    if (error.response.status >= 500) {
                        Nova.$emit('error', error.response.data.message)
                        return
                    }

                    if (error.response.status === 404 && this.initialLoading) {
                        this.$router.push({ name: '404' })
                        return
github swisnl / laravel-nova-mirror / resources / js / components / Metrics / TrendMetric.vue View on Github external
fetch() {
            this.loading = true

            Minimum(Nova.request().get(this.metricEndpoint, this.metricPayload)).then(
                ({
                    data: {
                        value: { labels, trend, value, prefix, suffix, format },
                    },
                }) => {
                    this.value = value
                    this.labels = Object.keys(trend)
                    this.data = {
                        labels: Object.keys(trend),
                        series: [
                            _.map(trend, (value, label) => {
                                return {
                                    meta: label,
                                    value: value,
                                }
                            }),
github swisnl / laravel-nova-mirror / resources / js / components / GlobalSearch.vue View on Github external
async fetchResults(search) {
            this.results = []

            if (search !== '') {
                try {
                    const { data: results } = await Minimum(
                        Nova.request().get('/nova-api/search', {
                            params: { search },
                        })
                    )

                    this.results = results

                    this.loading = false
                } catch (e) {
                    this.loading = false
                    throw e
                }
            }
        },
github swisnl / laravel-nova-mirror / resources / js / components / Metrics / ValueMetric.vue View on Github external
fetch() {
            this.loading = true

            Minimum(Nova.request().get(this.metricEndpoint, this.rangePayload)).then(
                ({
                    data: {
                        value: { value, previous, prefix, suffix, format },
                    },
                }) => {
                    this.value = value
                    this.format = format || this.format
                    this.prefix = prefix || this.prefix
                    this.suffix = suffix || this.suffix
                    this.previous = previous
                    this.loading = false
                }
            )
        },
    },
github swisnl / laravel-nova-mirror / resources / js / views / Lens.vue View on Github external
this.$nextTick(() => {
                this.clearResourceSelections()

                return Minimum(
                    Nova.request().get('/nova-api/' + this.resourceName + '/lens/' + this.lens, {
                        params: this.resourceRequestQueryString,
                    })
                ).then(({ data }) => {
                    this.resources = []

                    this.resourceResponse = data
                    this.resources = data.resources
                    this.softDeletes = data.softDeletes
                    this.hasId = data.hasId

                    this.loading = false

                    this.getAllMatchingResourceCount()

                    if (!this.hasId) {
github swisnl / laravel-nova-mirror / resources / js / views / Index.vue View on Github external
this.$nextTick(() => {
                this.clearResourceSelections()

                return Minimum(
                    Nova.request().get('/nova-api/' + this.resourceName, {
                        params: this.resourceRequestQueryString,
                    })
                ).then(({ data }) => {
                    this.resources = []

                    this.resourceResponse = data
                    this.resources = data.resources
                    this.softDeletes = data.softDeletes

                    this.loading = false

                    this.getAllMatchingResourceCount()
                })
            })
        },
github swisnl / laravel-nova-mirror / resources / js / components / Metrics / PartitionMetric.vue View on Github external
fetch() {
            this.loading = true

            Minimum(Nova.request(this.cardEndpoint)).then(({ data: { value: { value } } }) => {
                this.chartData = value
                this.loading = false
            })
        },
    },

laravel-nova

Supporting modules for Laravel Nova

MIT
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis