Search
 
SCRIPT & CODE EXAMPLE
 

PHP

spatie activity log

activity()->log('Look mum, I logged something');
Comment

spatie activity log sample

activity()
   ->performedOn($anEloquentModel)
   ->causedBy($user)
   ->withProperties(['customProperty' => 'customValue'])
   ->log('Look mum, I logged something');

$lastLoggedActivity = Activity::all()->last();

$lastLoggedActivity->subject; //returns an instance of an eloquent model
$lastLoggedActivity->causer; //returns an instance of your user model
$lastLoggedActivity->getExtraProperty('customProperty'); //returns 'customValue'
$lastLoggedActivity->description; //returns 'Look mum, I logged something'
Comment

spatie/laravel-activitylog display only changed data

protected static $logAttributes = [];     

public static function boot()
{
    parent::boot();
    static::saving(function (Model $model) {
        static::$logAttributes = array_keys($model->getDirty());
    });
}
Comment

spatie laravel activity log

php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations"
Comment

PREVIOUS NEXT
Code Example
Php :: php ip log 
Php :: php redirect with query string 
Php :: laravel validation custom message 
Php :: new session php 
Php :: wp image size names 
Php :: php loop html select option 
Php :: php sodium extension xampp 
Php :: session_start cookie lifetime 
Php :: php get first character of each word 
Php :: laravel collective form include image 
Php :: how to include file in php 
Php :: array search multidimensional php 
Php :: get value from url in laravel blade 
Php :: wordpress is_tag function 
Php :: wp_list_custom_post type 
Php :: export to excel in php 
Php :: php array insert before key 
Php :: php add variable to array 
Php :: php multiple variables assign same value 
Php :: php undefined function mysqli_fetch_all() 
Php :: codeigniter base_url 
Php :: php artisan tinker encryption cmd 
Php :: PHP MySQL Use The ORDER BY Clause 
Php :: Root composer.json requires php ^7.1.3 but your php version (8.0.3) does not satisfy that requirement. 
Php :: how to set up the laravel ssh keygen 
Php :: setcookie in php 
Php :: include blade file in laravel 
Php :: the uploaded file exceeds the upload_max_filesize directive in php.ini. wordpress 
Php :: php file upload 
Php :: laravel create session table 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =