#### Category : laravel-nova

Reaching the professionals here. I have been struggling with this for a while now, and can’t find a solution. I want to add a user field in the Rating nova resource that returns a user through relationships who created the article. This should return a relationship object like: BelongsTo::make(‘createdByUser’), The database fields are as follows: ..

Good day to all. Hopefully I could get a bit of help with this. It seems that I can’t retrieve user relationship that created the opportunity in the Feedback resource: (the user should be retrieved via opportunity resource / table) I have three tables of interest. **Feedback** id user_id opportunity_id **Opportunity** id created_by **User** id ..

Good day to all. Hopefully I could get a bit of help with this. It seems that I can’t retrieve user relationship that created the opportunity in the Feedback resource: (the user should be retrieved via opportunity resource / table) I have three tables of interest. **Feedback** id user_id opportunity_id **Opportunity** id created_by **User** id ..

I created a Laravel Nova component and published it in production. Then I changed default values for this component. In local, I can see the changes. But when I publish in production, changes are not reflected. I tried several things: npm run prod to publish optimized assets I double checked my component is updating version ..

I have the following problem: Users (that are not admins) can view a resource (for example my resource documents) if they access it directly via a link. I’ve modified the indexquery so that they cannnot see the resource on the index view but they also should get a 403 when they try to access it ..

I am working with spatie media library to store my images. On the frontend site I am using Quill editor with Vue js to give users the option to modify their posts. The users on the frontend also have the option to upload images. Those images get send in base64 within the content. On the ..

I am using Laravel Nova to administrate my project. However, I save certain values in my database like percentages or prices as x*100. Why I am doing this? Because when saving numbers *100 I can store them as int instead of double or float. However, this leads to the problem that I am seeing the ..

I’m trying to do that my results in trend metrics would be divided by 100. For example aggregate column is currency in value is cents. I need to divide it by 100 to display value in Euros. As I checked numeraljs there is Manipulate section and .divide(100) function, but how to do this with ->format(), ..

When using nova fields, I can pass an array of attributes that will appear regarding certain resource so I can view or edit. It mainly goes like this: public function fields(Request $request) { return [ ID::make()->sortable(), Text::make(‘Name’)->rules([ ‘required’, ‘max:255’ ]), BelongsToMany::make(‘Customers’), } The current issue is that I have a rather complex relation that includes .. Read more Is there a way to re-use existing Nova components (such as resource index/table view) in custom Tools? For example, I have a tool that has some complex filters and fetching operations of multiple models/resources. However, in certain parts, I want to display those resources as they are already defined in Nova’s Resource class (i.e. what .. Read more I have the following relations class Customer { public function orders() { return$this->hasMany(‘AppOrder’); } public function marketingDiscountCode() { return $this->belongsToMany(MarketingDiscountCode::class, ‘customer_marketing_discount_code’); } } class MarketingDiscountCode { public function customers() { return$this->belongsToMany(Customer::class, ‘customer_marketing_discount_code’); } } How can I add orders method in MarketingDiscountCode that mainly executes the following the query: select * from orders ..

I’m using the Laravel Repository Pattern to manage my resources and I was wondering how can I use an interface inside a Nova Action? Since an Interface cannot be instanciated, I was wondering how I could use my Interfaces within my action? In my Controller constructor I create my repository and then I’m able to ..

I’m gonna make a Unit Testing for my resource. Here my testing function below : public function testCreateMyResource() { $user = factory(AppUser::class)->states(‘admin’)->create();$this->actingAs($user);$data = [ ‘Field’ => "Example", ]; $response =$this->actingAs($user)->postJson(‘/nova-api/my-resource?editing=true&editMode=create’,$data); $response->assertStatus(201);$response->assertJson([‘status’ => true]); $response->assertJson([‘message’ => "Created!"]); } But it was return 403. I expected to return 201 as I login normally .. Read more First post so forgive my ignorance if it shows! I’m never to Nova than Laravel and that’s not much experience to being with! Just trying to figure out how to solve a business problem… This video is about Nova resource relationships. Looks pretty straightforward EXCEPT I get an 1054 error when I try assigning a .. Read more First post so forgive my ignorance if it shows! I’m never to Nova than Laravel and that’s not much experience to being with! Just trying to figure out how to solve a business problem… This video is about Nova resource relationships. Looks pretty straightforward EXCEPT I get an 1054 error when I try assigning a .. Read more When I do Create or Update in the form that have Trix Field, it always autofocus on Trix Field. So I need to make Autofocus to first input in stead. Sourc.. Read more I have a project structure where Nova and APIs are hosted on nova.mydomain.com and api.mydomain.com. When I tried to access vapor-ui URL with plain domain name it is not working whereas it works with the subdomains. The question is, how can I set up a subdomain for VaporUI as well, I am unable to find .. Read more Hi is there any way to insert data in two tables in one request laravel nova belongsTo relation What I am trying to achieve is that I have two models first is the user model & the second one is the student Model User model has email and password And student model has other profiling .. Read more Laravel Nova suggests Value Metrics and the ranges are for previous days until today. It is okay while we are using created_at as the default date column to show the result. But, sometimes we need to show the result based on a date column that is able to contain a value for later days. For .. Read more I’m looking for a way to override the cancel and update buttons on a resource. I’m new’ish to Nova. I would like to add a class to the container for the cancel and update actions (see image). So far I can’t figure out how to do that. There doesn’t seem to be any unique class .. Read more I want to add multiple languages ​​for the panel. For example, I want to change sources, logout, copyright and similar fields. How can I do it. Are there any Laravel nova packages? Sourc.. Read more Is there a way to display in Laravel Nova Resource a relation like this ?$report->meter->user where – a report belongs to a meter – a meter belongs to a user I am in report ressource and I want to display related user Sourc..

I have a products, teams, and categories table. I am trying to assign a Team to a Product. When a Team is assigned to that Product, they get one or more Category made available to them for that Product. The problem is, I don’t want to pull from the main categories table when assigning categories ..

I have a Filter configured for my Nova Resource. It applies the status: public function apply(Request $request,$query, $value) { return$query->where(‘status’, \$value); } This works fine for the Table, but I have some Metrics configured on the Index as well. Is there a way for me the apply the active filter also on the ..

I use a custom local disk: ‘brand_pdf’ => [ ‘driver’ => ‘local’, ‘root’ => storage_path(‘app/public/brand_pdf’), ‘url’ => env(‘APP_URL’) . ‘/storage/brand_pdf’, ‘visibility’ => ‘public’, ], In the database the file path saved in pdf column, e.g. placeholder.pdf. In the model in fields method: File::make(‘Description’, ‘pdf’)->disk(‘brand_pdf’), I’ve created a symlink by php artisan storage:link. I can upload ..