3 Commits
2 changed files with 27 additions and 3 deletions

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
## How to install
1. Install the package `composer require mathiaspalmqvist/laravel-cision-feed`
2. add the cision company slug to `LARAVEL_CISION_FEED_SLUG` at your env
## Functions
`LaravelCisionFeed::all();`
Returns everyting from the feed.
`LaravelCisionFeed::press();`
Returns all press releases from the feed.
`LaravelCisionFeed::financial();`
Returns all financial reports from the feed.
`LaravelCisionFeed::news();`
Returns all news from the feed.
`LaravelCisionFeed::media();`
Returns all media from the feed.
+7 -3
View File
@@ -19,7 +19,7 @@ class LaravelCisionFeed
return false;
}
return self::parse($request->body());
return self::parse($request->body(), $page);
}
/**
@@ -108,9 +108,10 @@ class LaravelCisionFeed
/**
* @param string|null $data
* @return array|false
* @param int $page
* @return bool|array
*/
private static function parse(string $data = null): bool|array
private static function parse(string $data = null, int $page = 1): bool|array
{
if ($data === null) {
return false;
@@ -136,6 +137,9 @@ class LaravelCisionFeed
];
}
$return['previous_page'] = $page > 1 ? $page-- : false;
$return['next_page'] = count( $rows['channel']['item'] ) === 24 ? ++$page : false;
return $return;
}
}