Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yubarajshrestha/iarticles
Instant Article and/or Feed Generator for your website.
https://github.com/yubarajshrestha/iarticles
laravel
Last synced: 7 days 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-07T10:34:15.000Z (about 5 years ago)
- Last Synced: 2024-12-12T06:32:52.095Z (11 days ago)
- Topics: laravel
- Language: PHP
- Homepage: https://yubarajshrestha.github.io/iarticles/
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# iArticles
[![GitHub stars](https://img.shields.io/github/stars/yubarajshrestha/laravel-module.svg)](https://github.com/yubarajshrestha/iarticles/stargazers)
[![Latest Stable Version](https://poser.pugx.org/yubarajshrestha/iarticles/v/stable)](https://packagist.org/packages/yubarajshrestha/iarticles)
[![Total Downloads](https://poser.pugx.org/yubarajshrestha/iarticles/downloads)](https://packagist.org/packages/yubarajshrestha/iarticles)
[![License](https://poser.pugx.org/yubarajshrestha/iarticles/license)](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:.