how sluggify a model with cviebrock slugs laravel -


i ran simple problem. installed this package , wish sluggify entire model.

i have upgraded m model definition instructed:

protected $sluggable = array(     'build_from' => 'fullname',     'save_to'    => 'slug', );    public function getfullnameattribute() {     return $this->firstnames . '-' . $this->surname; } 

but lost...

how sluggify records in table?

ok, know. package's author wrote in readme.md, each record can reslugged on save.

so came op crude working solution:

in index method:

$object = author::get();  foreach($object $o) { $o->save(); } 

Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -