{"repo":"mattiverse/Laravel-Userstamps","free":true,"listed":false,"github":"https://github.com/mattiverse/Laravel-Userstamps","clone":"git clone https://github.com/mattiverse/Laravel-Userstamps.git","description":"Laravel Userstamps provides an Eloquent trait which automatically maintains created_by and updated_by columns on your model, populated by the currently authenticated user in your application.","language":"PHP","stars":755,"topics":["laravel","laravel-package","userstamps","trait","php"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"About Laravel Userstamps Laravel Userstamps provides an Eloquent trait which automatically maintains created by and updated by columns on your model, populated by the currently authenticated user in your application. When using the Laravel SoftDeletes trait, a deleted by column is also handled by this package. Installing This package requires Laravel 9 or later running on PHP 8.2 or higher. This package can be installed using composer: Usage Your model will need to include a created by and updated by column, defaulting to null . If using the Laravel SoftDeletes trait, it will also need a deleted by column. The column type should match the type of the ID column in your user's table. Userstamp columns can be created using: Equivalent methods are also available when working with UUIDs. You can now load the trait within your model, and userstamps will automatically be maintained: Optionally, should you wish to override the names of the created by , updated by or deleted by columns, you can do so by setting the appropriate class constants on your model. Ensure you match these column names in your migration. When using this trait, helper relationships are available to let you retrieve the user who created, updated and deleted (when using the Laravel SoftDeletes trait) your model. Methods are also available to temporarily stop the automatic maintaining of userstamps on your models: Resolving Users By default users will be resolved using the Laravel Auth::id() method, to return the I","default_branch":null,"files":null,"tree":[],"storefront":"/r/mattiverse","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mattiverse/Laravel-Userstamps/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}