netcore/galerts

Google Alerts management

1.0.1 2017-07-10 13:25 UTC

This package is not auto-updated.

Last update: 2024-12-13 21:40:43 UTC


README

Installation

  1. Install package using command
    composer require netcore/galerts
  1. Add service provider to your app.php file
    'providers' => [
        ...
        Netcore\GAlerts\GAlertsServiceProvider::class,
    ]

Usage

At the top of your controller/service put the following

    use Netcore\GAlerts\GAlert;
  • Fetch all existing alerts
    GAlert::all();
  • Find alert by data id
    GAlert::findByDataId('28764d5015595ee0:60bb6f517d7861db:com:en:US:L');
  • Find alert by data id
    GAlert::findByKeyword('My alert');
  • Create an alert
    $alert = new GAlert;
    
    $alert = $alert
        ->keyword('My alert')
        ->deliverToEmail()
        ->frequencyWeekly()
        ->language('lv')
        ->save();
  • Update an existing alert
    $alert = GAlert::findByKeyword('My alert');
   
    $updated = $alert
        ->keyword('My new alert')
        ->deliverToFeed()
        ->update();
  • Delete an alert
    $alert = GAlert::findByKeyowrd('My alert');
   
    $alert->delete();