Associate models with URL links.
You can install the package via composer:
composer require laratree/laravel-link
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-link-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag=":laravel-link"
This is the contents of the published config file:
return [
'table' => 'links',
];
// Register Trait on User model.
use HasLink;
// Attach Link to User
$user = User::latest()->first();
$user->attachLink($url = 'https://portfolio.com');
// Delete Link
$user->deleteLink('https://portfolio.com');
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.