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 activity log

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

PREVIOUS NEXT
Code Example
Php :: laravel factory pass parameter 
Php :: remove space and line from json in php 
Php :: php and ajax on select option 
Php :: match php 
Php :: PDO Prepared Statement php 
Php :: php pdo like 
Php :: asset function in laravel not working 
Php :: laravel new line in session flash message 
Php :: laravel rate limit 
Php :: laravel migration table softdeletes 
Php :: add character after x characters in php 
Php :: php artisan serve stop 
Php :: finding second highest number in array 
Php :: twig in array 
Php :: php try catch non object 
Php :: phpmyadmin export database 
Php :: Regex to remove span tags using php [duplicate] 
Php :: convert to string php 
Php :: laravel move/rename file ftp 
Php :: laravel route 
Php :: php strip url of all invalid characters 
Php :: PHP Parses a time string according to a specified format 
Php :: Trying to access variable outside laravel collection 
Php :: check array has keys in php 
Php :: laravel collection flatMap 
Php :: php date now 
Php :: Get the current script file name 
Php :: phpmailer doesnt work 
Php :: php is_assoc 
Php :: php file upload code not working in ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =