News Articles laravel-nova

How can the css variable from be changed dynamically from `Laravel Nova`?

I am using Nova Settings in which a Color picker field is used. NovaServiceProvider- OptimistDigitalNovaSettingsNovaSettings::addSettingsFields([ Panel::make(‘Colors’, [ Color::make(‘Primary color’)->slider(), Color::make(‘Secondary color’)->slider(), ]), ]); $primary-color = nova_get_setting(‘primary_color’); In my CSS file – :root { –primary-color: rgb(255, 0, 0); //want the nova color setting to be used here –secondary-color: rgb(255, 197, 6); } How can the Nova […]

How to add global custom hook on delete for frontend part of Laravel Nova

So my question is how to add global custom hook on delete for frontend part of Laravel Nova? I understand that I should put following code somewhere, but I don’t really understand where exactly because of components based architecture. Nova.$on(‘resource-deleted’, function () { Nova.success(‘success’); }) Source: Vue – Stack Overflow

v-for duplicating th of tr same code is working fine for other objects

I have seen few solutions online but It did not solve my problem. I am getting JSON object in the response. <!– Show Negativita Check Azienda –> <table class="divide-y divide-gray-200 table-fixed w-full mt-4" v-if="showTableAzienda" v-for="item in impreses"> <thead class="bg-gray-900"> <tr> <th>Codice Fiscale</th> <th>Flag Domande</th> <th>Flag Pregiudizievoli</th> <th>Flag Procedure</th> <th>Flag Protesti</th> <th>Data Evasione</th> </tr> </thead> <tbody […]

How to store/cache request data from CMS in Vue3?

I’ve built a primitive Content Management System with Laravel Nova in a Vue3/Laravel8 app. Being the noob I am, I am using axios.get to get image links and markdown from a database and assign it to a reactive state like so: <script setup> import {reactive} from ‘vue’; import DOMPurify from "dompurify"; import marked from "marked"; […]

Laravel Nova – How to store images in Cache?

I’ve built a Vue3/Laravel8 app and linked the frontend to a database with Laravel Nova. Problem is that now my frontend has to wait for the database links for the image files every time the app is refreshed or a new router link is loaded. This kinda screwed up the benefit of having a Vue […]

Laravel Nova – How to render Markdown field in Vue3?

I followed the Nova doc and linked a Markdown field to a TEXT database type: Markdown::make(‘Content’, ‘content_text’) I want to render it in the right format on my web app: but it renders just the string content abolishing the format: The field data is acquired like this: const state = reactive({ content: "" }) axios.get(‘/donate’) […]

How to render Markdown field in Vue3?

I followed the Nova doc and linked a Markdown field to a TEXT database type: Markdown::make(‘Content’, ‘content_text’) I want to render it in the right format on my web app: but it renders just the string content abolishing the format: The field data is acquired like this: const state = reactive({ content: "" }) axios.get(‘/donate’) […]

Stack-Fields not displaying in create/edit page in Laravel Nova

I habe this field function inside my Resource: public function fields(Request $request) { return [ ID::make(__(‘ID’), ‘id’)->sortable(), Stack::make(‘Headings’, [ Text::make(‘Heading (en)’), Text::make(‘Heading (de)’), Text::make(‘Heading (ar)’), ]), Stack::make(‘Content’, [ Text::make(‘Content (en)’), Text::make(‘Content (de)’), Text::make(‘Content (ar)’), ]), Image::make(‘Image’)->disk(‘public’)->prunable(), ]; } which produces this view: but as soon as I want to create/edit an entry, it only shows […]

CORS header ‘Access-Control-Allow-Origin’ missing in ubuntu

I am new to laravel-nova and vuejs. I am sending a request to my private-api swagger. I have tried everything i could. I changed the conf file of my apache server given here mozailla documentation on cors. I have tried putting axios.defaults.headers.common[‘Access-Control-Allow-Origin’] = ‘*’; while sending the request. it did not work. this is my […]

How can a Email Notification for password reset be sent from Nova Actions for a User?

There is an InvitationNotification which runs on using Action on Users Invitation Action – public function handle(ActionFields $fields, Collection $models) { foreach ($models as $model) { $model->notify(new InvitationNotification($model->email)); $model->invitation_sent = true; $model->save(); } } Invitation Notification- public function toMail($notifiable) { return (new MailMessage) ->action(Lang::get(‘Reset Password’), url(‘/’)); //the password.reset url with token } Route::get(‘/reset-password/{token}’, [NewPasswordController::class, ‘create’])->name(‘password.reset’); […]

How to show image in laravel nova custom card?

I have created custom laravel nova card which shows list of items as follows: menus:[ { logo: require("../assets/client.png"), name: "Clients", redirection: "clients" } ] following is template code: <div v-for="menu in menus" :key="menu"> <a @click="handleMenuClick(menu.redirection)"> <img :src="menu.logo" /> {{ menu.name }} </a> </div> My vue component path is /resources/js/components/ I have created assets folder in […]

Laravel Nova Custom Field – How to save multiple fields to the model

I have been working on updating an old nova package (custom field) that does google maps and google places autocomplete. I have managed to work out how the custom field goes together, but I’m a bit lost on how to save more than one input box to the model on save. this is the package: […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.