Category : laravel-nova

When I started to develop some custom field for Laravel Nova, I generated the files in the nova-components folder, but when I wanted to install npm dependencies, I got an error: npm ERR! code 1 npm ERR! path /var/www/pafi/nova-components/Json/node_modules/pngquant-bin npm ERR! command failed npm ERR! command sh -c node lib/install.js npm ERR! ⚠ The `/var/www/pafi/nova-components/Json/node_modules/pngquant-bin/vendor/pngquant` ..

Read more

I’m having some troubles with nova menu buider, because I don’t understand how to create a class that extends the OptimistDigitalMenuBuilderOptimistDigitalMenuBuilderMenuItemTypesBaseMenuItemType class. In the nova-menu.php I’ve added the following code: ‘menu_item_types’ => [ AppMenuItemTypesCustomMenuItemType::class, ], In the app folder of my Laravel project, I’ve added a new folder named MenuItemTypes and inside that I’ve created ..

Read more

In a Nova resource, I show a BelongsToMany Nova Field. I would want to simply concatenate (prepending) a "check pictogram" before options values of this field, if they are already attached to the Nova resource. I’ve tried to use: BelongsToMany::make(__(‘Circuits’), ‘circuits’, Circuit::class)->displayUsing(function ($name) { return ‘…’; }), and BelongsToMany::make(__(‘Circuits’), ‘circuits’, Circuit::class)->resolveUsing(function ($name) { return ‘…’; ..

Read more

I am new to Laravel Nova Framework. I have stored Image using Image upload filed.I am using concept of blob to same image. Application Model ( Name , Description , Image ) -> ApplicationAttachment -> Blob Now, in show Resource page, I want to show the image. Can Someone suggest, how can I show the ..

Read more

I have created a Laravel 8 custom Tool. It contains two inputs. For example: <input v-model="month_price" name="month_price" id="month_price" type="text" class="w-full form-control form-input form-input-bordered" />. In the Vue.JS file I have set this data function: <script> export default { metaInfo() { return { title: ‘Appprices’, } }, data: function () { let vue = this; Nova.request().get(‘get_app_prices’) ..

Read more

I’m having an issue with storing the original file name both in the database and in disk storage. The file saves correctly in the database and in the Nova backend, but in the disk storage is just saves as a random string. In the database: my-user-friendly-file-name.pdf In the disk storage: kfnakfncanjnaskdmkasniodanwjioeocniosandoaisndcacs.pdf I have followed the ..

Read more

Given the Nova class class Article extends Resource { // […] public function fields(Request $request) { return [ ID::make() ->sortable(), Image::make(‘Image’, ‘filename’) ->disk(‘public’) ->path(‘articles’) ->prunable(), ]; } // […] } Why do I get this error when I upload an image? SQLSTATE[HY000]: General error: 1364 Field ‘filename’ doesn’t have a default value (SQL: insert into ..

Read more

Can someone help me out with adding vuex-orm to a Laravel Nova Tool. The base of a Laravel Nova tool has tool.js with the following content (‘planning-tool’ in name, and path may vary according to the name of your tool): Nova.booting((Vue, router, store) => { router.addRoutes([ { name: ‘planning-tool’, path: ‘/planning-tool’, component: require(‘./components/Tool’), }, ]) ..

Read more

I have 2 tables, one is templates and second posts, I want to make some functionality in Nova where I can via Nova actions or something else create a post from the template. so after clicking, I want to be redirected to a new post page with some prefilled fields, is it possible in Nova? ..

Read more

In Laravel 8 Nova, I have created a Resource whose fields method contains the following: if(in_array($this->role, [‘city’, ‘pro’])) { $return[] = HasMany::make(__(‘Spots’), ‘spots’, Spot::class); } return $return; This if causes the many relationship listing in the View page of the Resource loading infinitely. When I remove it, it loads correctly the relationship entries. Do you ..

Read more

I’ve read the documentation here: https://nova.laravel.com/docs/3.0/metrics/registering-metrics.html#resource-detail-metrics But I’m not sure where to add this or how to implement. $request->resourceId I need the metric to match the resource based on the indexquery on the resource- goal. When I tried following the example I get an error saying I need 3 arguments for calculate. Can someone please ..

Read more