PHPackages                             kalimeromk/facebook-post - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kalimeromk/facebook-post

ActiveLibrary[API Development](/categories/api)

kalimeromk/facebook-post
========================

This package allow to create, update, delete and get posts from facebook page in laravel application

1.0.0(1y ago)114MITPHPPHP &gt;=7.4

Since Mar 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/KalimeroMK/FacebookPost)[ Packagist](https://packagist.org/packages/kalimeromk/facebook-post)[ RSS](/packages/kalimeromk-facebook-post/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Laravel Facebook Page Post
==========================

[](#laravel-facebook-page-post)

[![GitHub License](https://camo.githubusercontent.com/34253af8d33450fcbdeef2b3f39152e6376ceda3c316613e2d27c3a2a64180a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e617a6d756c373938392f6c61726176656c2d66616365626f6f6b2d706f73743f7374796c653d706c6173746963)](https://camo.githubusercontent.com/34253af8d33450fcbdeef2b3f39152e6376ceda3c316613e2d27c3a2a64180a0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e617a6d756c373938392f6c61726176656c2d66616365626f6f6b2d706f73743f7374796c653d706c6173746963)

This package allow to create, update, delete and get posts from facebook page in laravel application

Requirements
------------

[](#requirements)

- PHP &gt;=7.4

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require kalimeromk/facebook-post

```

Configuration
-------------

[](#configuration)

You can publish the configuration file `config/facebook.php` optionally by using the following command:

```
php artisan vendor:publish --tag=config --provider="Kalimeromk\FacebookPost\FacebookPostServiceProvider"

```

Configure `.env` file

```
FACEBOOK_PAGE_ID=your_facebook_page_id
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token

```

Usage
-----

[](#usage)

### Get All posts

[](#get-all-posts)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

$response = FacebookPost::getPost();

```

### Create Text post

[](#create-text-post)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

FacebookPost::storePost('Hello, this is a test post!');

```

### Create Text post with photo

[](#create-text-post-with-photo)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

FacebookPost::storePhotoPost('Check out this photo!', '/path/to/photo.jpg');

```

### Create Text post with video

[](#create-text-post-with-video)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

FacebookPost::storeVideoPost('Watch this video!', '/path/to/video.mp4');

```

### Update post

[](#update--post)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

FacebookPost::updatePost('post_id_here', 'Updated post message.');

```

### Delete post

[](#delete--post)

```
use Kalimeromk\FacebookPost\Facades\FacebookPost;

FacebookPost::deletePost('post_id_here');

```

### Example Success Response

[](#example-success-response)

```
array:4 [
  "status" => "success"
  "status_code" => 200
  "message" => "Post created successfully"
  "post_id" => "103408372435470_395802394384938"
]

```

### Example Failure Response

[](#example-failure-response)

```
array:3 [
  "status" => "fail"
  "status_code" => 422
  "message" => "Message is required"
]

```

Limitations
-----------

[](#limitations)

- You can update only the text of a post. Image is not updatable.
- Multiple image upload is not supported.
- Video upload is not supported

### How to generate access token?

[](#how-to-generate-access-token)

1. At first create a business type facebook app. Create app from [Facebook Deveoper Panel](https://developers.facebook.com/)
2. Go to Facebook [Graph Api Explorer](https://developers.facebook.com/tools/explorer/)
3. Here you will see three select option:

- Meta App
- User or Page
- Permissions

4. `Meta App`: Here you will see all facebook app that you have created. Select your business type app from the dropdown list.
5. `User or Page`: Here you need to select page access token. Then it will redirect you to your facebook page list. Select your preferred page and give necessary permission.
6. `Permissions`: Please select the following permission from this permission list

- `pages_show_list`
- `pages_read_engagement`
- `pages_manage_engagement`
- `pages_manage_posts`
- `pages_read_user_content`

7. Finally click on the Generate Access Token button and it will generate temporary access token for one hour.
8. If you want to make this token as long lived, you need to go [Access Token Debugger](https://developers.facebook.com/tools/debug/accesstoken/). Insert the access token and click on the `Debug` button. Then it will show token information. Scroll down this page and you will see `Extend Access Token`. Click on this button and it will generate long lived access token.Then copy the access token and use this as `FACEBOOK_ACCESS_TOKEN`

### Note:

[](#note)

If you want to generate never expiry access token, you need to follow this step:

- Please open an api testing tool like Postman and send a get request by using this url `https://graph.facebook. com/v22.0/{app-scoped-user-id}/accounts?access_token={long-lived-user-access-token}`. If you want to generate user access token instead of page access token, just select user access token from `User or Page` section that i have mentioned in step 5.
- Extend expiry date of this user access token as like as page access token extend method that i have mentioned in step 8.
- Then debug this `long-lived-user-access-token` and you will get `app-scoped-user-id` from this debug information.
- Finally send get request to this url `https://graph.facebook.com/v22.0/{app-scoped-user-id}/accounts?access_token= {long-lived-user-access-token}`. Now You will get never expiry page access token from this request and use this access token as `FACEBOOK_ACCESS_TOKEN`

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

### See [Facebook Page Api](https://developers.facebook.com/docs/pages-api) for more details

[](#see-facebook-page-api-for-more-details)

### See [Facebook Long Lived Access Token](https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived) for more details

[](#see-facebook-long-lived-access-token-for-more-details)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance42

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

479d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/472c4da0220f15747dd81d3a27ffbba022a06ab20f64a367ddcaacd790d812d7?d=identicon)[KalimeroMK](/maintainers/KalimeroMK)

---

Top Contributors

[![KalimeroMK](https://avatars.githubusercontent.com/u/24772657?v=4)](https://github.com/KalimeroMK "KalimeroMK (5 commits)")

---

Tags

apifacebooklaravelmetapackagephp

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/kalimeromk-facebook-post/health.svg)

```
[![Health](https://phpackages.com/badges/kalimeromk-facebook-post/health.svg)](https://phpackages.com/packages/kalimeromk-facebook-post)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
