Looking to hire Laravel developers? Try LaraJobs

laravel-link maintained by laratree

Description
Associate models with URL links
Author
Last update
2026/04/26 09:19 (dev-main)
License
Downloads
7

Comments
comments powered by Disqus

Laravel Links

Latest Version on Packagist GitHub Tests Action Status codecov Total Downloads

Associate models with URL links.

Installation

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',
];

Usage


// 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');

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.