vinkla/laravel-hashids

hashid issue

huggy06 opened this issue · 1 comments

Hi

We use Laravel 5.7 and "vinkla/hashids": "^5.1"

I added hashid in my model

class Listing extends Model {

use Hashidable;

protected $appends = ['hashid'];

public function getHashidAttribute() {
return \Vinkla\Hashids\Facades\Hashids::encode($this->attributes['id']);
}

In blade I try to use href="{{ route('listings.detail', $listing->hashid) }}"

But I get this error :

Undefined property: stdClass::$hashid (View: E:\Walky\walky\resources\views\listings\index.blade.php)

Any idea ?

Thanks

Not sure. Try clearing the view cache.