dainsys / ring_central
A full stack package to add ring_central functionality to Laravel applications.
v0.2.2
2023-03-01 19:27 UTC
Requires
- dainsys/mailing: ^1.0
- illuminate/support: ^8.0|9.0
- maatwebsite/excel: ^3.1|4.0
Requires (Dev)
- nunomaduro/collision: v5.x-dev
- orchestra/testbench: 6.x-dev
- phpunit/php-code-coverage: 9.2.x-dev
README
Extends ring central reports functionality.
Installation
- Require using composer:
composer require dainsys/ring_central
. - Add DB Connection values in your .env file:
RC_DB_HOST=
RC_DB_DATABASE=
RC_DB_USERNAME=
RC_DB_PASSWORD=
RC_DB_DRIVER=
- Run the migrations:
php artisan migrate
Ussage
- Make sure your commands extednds the
\Dainsys\RingCentral\Console\Commands\AbstractProductionReportCommand
. Alternatively, you may use therc:make-command
command to create your reports. - Your signature property must provide a required attribute for
dates
, which is required to run the reports. If none passed, today's date will be assumed. - This package uses
dainsys/mailing
package under the hood More details. Or, make sure to provide implementation for therecipients
method.- Using
dainsys/mailing
package:- Visit url
/mailing/admin/mailables
in your app and create a mailable record with the class name of the command. For current example,App\Console\Commands\PublishingProductionReport
. - Visit url
/mailing/admin/recipients
to create new recipients associate them with the created mailable report.
- Visit url
- Providing your oun implementation in your report commands:
protected function recipients(): array { return []; }
- Using
- Provide implementation to all abstract methods required. Use the following code as an example.
<?php namespace App\Console\Commands; use Dainsys\RingCentral\Console\Commands\ProductionReportCommand; class PublishingProductionReport extends ProductionReportCommand { /** * The name and signature of the console command. * * @var string */ protected $signature = 'publishing:production-report {dates?} Range of dates between the data will be queried. Exc: 2023-01-01 or 2023-01-01,2023-01-02. Today\'s date will be assumed if not passed! '; /** * List of dialGroups to query. Provide all dialGroups. * * @return array */ public function dialGroups(): array { // return ['PUB%']; } /** * List of teams to query. * * @return array */ public function teams(): array { // return ['ECC%']; } /** * Email subject */ public function subject(): string { return str($this->name)->replace(':', ' ')->headline(); } }