1. Go to this page and download the library: Download watson/nameable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
watson / nameable example snippets
use Watson\Nameable\Nameable;
class User extends Model
{
protected $casts = [
'name' => Nameable::class,
];
}
use Watson\Nameable\Name;
$name = new Name('Dwight', 'Conrad Watson');
$name = Name::from('Dwight Conrad Watson');