'calls.browse', 'create' => 'calls.create', 'update' => 'calls.update', 'destroy' => 'calls.destroy' ]; protected $moduleSettingsLinks = [ ['route' => 'calls.directiontype.index', 'label' => 'settings.directiontype'], ['route' => 'calls.status.index', 'label' => 'settings.status'], ]; protected $settingsPermission = 'calls.settings'; protected $showFields = [ 'information' => [ 'owned_by' => [ 'type' => 'assigned_to', ], 'call_date' => [ 'type' => 'text', ], 'subject' => [ 'type' => 'text', ], 'phone_number' => [ 'type' => 'text', ], 'duration' => [ 'type' => 'text', 'col-class' => 'col-lg-4 col-sm-4 col-md-4' ], 'direction_id' => [ 'type' => 'manyToOne', 'relation' => 'direction', 'column' => 'name', 'dont_translate' => true, 'col-class' => 'col-lg-4 col-sm-4 col-md-4' ], 'status_id' => [ 'type' => 'manyToOne', 'relation' => 'callStatus', 'column' => 'name', 'dont_translate' => true, 'col-class' => 'col-lg-4 col-sm-4 col-md-4' ], 'call_type' => [ 'type' => 'text', 'col-class' => 'col-lg-6 col-md-6 col-sm-6 col-xs-6' ], 'account_id' => [ 'type' => 'manyToOne', 'relation' => 'account', 'column' => 'name', 'dont_translate' => true, 'col-class' => 'col-lg-3 col-sm-3 col-md-3' ], 'contact_id' => [ 'type' => 'manyToOne', 'relation' => 'contact', 'column' => 'full_name', 'dont_translate' => true, 'col-class' => 'col-lg-3 col-sm-3 col-md-3' ], 'lead_id' => [ 'type' => 'manyToOne', 'relation' => 'lead', 'column' => 'full_name', 'dont_translate' => true, 'col-class' => 'col-lg-3 col-sm-3 col-md-3' ], 'deal_id' => [ 'type' => 'manyToOne', 'relation' => 'deal', 'column' => 'name', 'dont_translate' => true, 'col-class' => 'col-lg-3 col-sm-3 col-md-3' ], ], 'notes' => [ 'notes' => [ 'type' => 'text', 'col-class' => 'col-lg-12 col-sm-12 col-md-12' ], ], ]; protected $languageFile = 'calls::calls'; protected $routes = [ 'index' => 'calls.calls.index', 'create' => 'calls.calls.create', 'show' => 'calls.calls.show', 'edit' => 'calls.calls.edit', 'store' => 'calls.calls.store', 'destroy' => 'calls.calls.destroy', 'update' => 'calls.calls.update' ]; public function __construct() { parent::__construct(); } public function afterStore($request, &$entity = NULL) { // If entity has a lead_id, log creation activity for the Lead too if (!empty($entity->lead_id)) { $extension = \Auth::id(); // ID of the authenticated user $time = now(); // Current timestamp $insertions[] = [ 'description' => 'Craete Call log', 'subject_id' => $entity->lead_id, 'subject_type' => 'Modules\Leads\Entities\Lead', 'causer_id' => $extension, 'causer_type' => 'Modules\Platform\User\Entities\User', 'properties' => '[]', 'created_at' => $time, 'updated_at' => $time ]; \DB::table('activity_log')->insert($insertions); } } }