Closed dani7115 closed 2 years ago
have you published the vendor?
Yes I did. Even I had doubt maybe I did something wrong. So I did this again 3 times from the start. But still wasn't able to fix this.
Please show the import statement on the top of the file
These are the imports for the controller that i'm using for testing
<?php
namespace App\Http\Controllers;
use App\Models\Company;
use App\Models\Product;
use Illuminate\Http\Request;
And these are for SERVICE APP PROVIDER
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Rinvex\Attributes\Models\Attribute;
try to import them as
use \Rinvex\Attributes\Models\Type\Varchar as Varchar1
and then use it in your code
Sorry about that, I pushed a fix the docs. The correct code should be as follows:
$values = $attribute->values(\Rinvex\Attributes\Models\Type\Varchar::class)->get();
Hi, Following your documentation. I am trying to do this one.
// Get all attribute values of type varchar
$values = $attribute->values('varchar')->get();
But it gives me error " Class 'varchar' not found "
As I've already done some research and tried to register attributes types in my APP SERVICE PROVIDER .
Which is fine. But still this error is appearing Also, i have confirmed that the FILE exists in my Rinvex vendor directory.
Can u let me know how I can fix it for me?