https://github.com/yubarajshrestha/iarticles
Instant Article and/or Feed Generator for your website.
https://github.com/yubarajshrestha/iarticles
laravel
Last synced: 7 months ago
JSON representation
Instant Article and/or Feed Generator for your website.
- Host: GitHub
- URL: https://github.com/yubarajshrestha/iarticles
- Owner: yubarajshrestha
- License: mit
- Created: 2019-09-05T11:26:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-07T10:34:15.000Z (almost 6 years ago)
- Last Synced: 2025-03-26T14:13:22.785Z (7 months ago)
- Topics: laravel
- Language: PHP
- Homepage: https://yubarajshrestha.github.io/iarticles/
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# iArticles
[](https://github.com/yubarajshrestha/iarticles/stargazers)
[](https://packagist.org/packages/yubarajshrestha/iarticles)
[](https://packagist.org/packages/yubarajshrestha/iarticles)
[](https://packagist.org/packages/yubarajshrestha/iarticles)**If you are seeking package for generating instant article or feeds then yes, this package is for you.**
> This helps you generate facebooks instant articles and also regular feeds with enough customizations you might need.
### How to?
#### Step 1: Install packageInstall package by executing the command.
```shell
composer require yubarajshrestha/iarticles
```#### Step 2: Publish Vendor Files
You need to have some files and don't worry it's quite easy. You just want to execute the command now.```shell
php artisan vendor:publish --tag=iarticles
```#### Step 3: Update Configurations
You need to define options in your `iarticles` configuration file. You'll find default options from where you will get an idea on how to configure things.#### Step 4: Implement Instant Article Interface to your Model and configure as follows
```php
use YubarajShrestha\IArticles\InstantArticle;
use YubarajShrestha\IArticles\Articles;
class YourModel implements InstantArticle {/**
* Instant Article
* @return Collection of YourModel
*/
public static function getFeedItems()
{
return YourModel::latest()->get()->take(25);
}/**
* Filter Feed Data
* @return iArticle Object
*/
public function iArticle()
{
return Articles::create([
'id' => $this->id, // required | integer
'title' => $this->name, // required | string
'subtitle' => '', // nullable | string
'kicker' => $this->kicker, // nullable | string
'summary' => '', // required | string
'description' => '', // required | string
'cover' => '', // nullable | string
'updated' => '', // required | date
'published' => Carbon::parse($this->created_at), // required | date
'link' => '', // full url to item...
'author' => '' // nullable | email | string
]);
}
}
```#### Step 5: Awesome
1. Your project is now ready to go :+1:.