PHPackages                             sagor/github-updater - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sagor/github-updater

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sagor/github-updater
====================

A Laravel package for automated Github pulls and Artisan commands by moh-sagor.

v1.0.8(1y ago)0541MITPHPPHP ^7.2 || ^8.0

Since Feb 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/moh-sagor/github-updater)[ Packagist](https://packagist.org/packages/sagor/github-updater)[ Docs](https://github.com/moh-sagor/github-updater)[ RSS](/packages/sagor-github-updater/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

GithubUpdater for Laravel
=========================

[](#githubupdater-for-laravel)

A Laravel package for automated GitHub pulls and running Artisan commands, developed by Md Sagor Hossain.

Description
-----------

[](#description)

`sagor/github-updater` is a Laravel package that simplifies pulling the latest changes from a GitHub repository and executing predefined Artisan commands (e.g., migrations, seeding) in a single step. It provides both a console command (`php artisan github:pull`) and a web route (`/github-pull`) for convenience.

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

[](#requirements)

- PHP 7.4–8.4
- Laravel 8.x, 9.x, 10.x, 11.x or 12.x
- Git installed on the server

**Note**: PHP 7.4 reached end-of-life on November 28, 2022, and no longer receives security updates. We recommend using PHP 8.0 or higher for security and performance reasons.

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

[](#installation)

Install the package via Composer:

```
composer require sagor/github-updater
```

The package uses Laravel's auto-discovery to register the service provider. If auto-discovery is disabled, manually add the service provider to `config/app.php`:

```
'providers' => [
    // ...
    Sagor\GithubUpdater\Providers\GithubUpdaterServiceProvider::class,
],
```

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

[](#configuration)

Publish the configuration file to customize the package settings:

```
php artisan vendor:publish --tag=config
```

This will create a `config/github-updater.php` file with the following default configuration:

```
return [
    'github_token' => env('GITHUB_TOKEN', ''),
    'github_username' => env('GITHUB_USERNAME', ''),
    'github_repo_link' => env('GITHUB_REPO_LINK', ''),
    'artisan_commands' => env('ARTISAN_COMMANDS', 'php artisan migrate --force, php artisan db:seed'),
];
```

### Environment Variables

[](#environment-variables)

Set the following environment variables in your `.env` file:

```
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_USERNAME=your_github_username
GITHUB_REPO_LINK=your_repository_link (e.g., github.com/moh-sagor/project-url.git)
ARTISAN_COMMANDS="php artisan migrate --force,php artisan db:seed"
```

**Security Note**: Ensure your `GITHUB_TOKEN` is kept secure and not exposed in logs or public repositories.

Usage
-----

[](#usage)

### 1. **Console Command**

[](#1-console-command)

Run the following Artisan command to pull the latest changes from GitHub and execute the configured Artisan commands:

```
php artisan github:pull
```

This command:

- Executes `git pull` to fetch the latest changes from the GitHub repository.
- Runs the Artisan commands specified in `ARTISAN_COMMANDS` (e.g., `php artisan migrate --force` and `php artisan db:seed`).

**Output**: The command provides feedback on the progress and any errors encountered.

### 2. **Web Route**

[](#2-web-route)

Access the web route to trigger the same functionality via a browser or API:

```
GET /github-pull

```

This route:

- Pulls the latest changes from GitHub.
- Executes the configured Artisan commands.
- Displays the output in a terminal-like format in the browser.

**Note**: The route is protected by the `web` middleware. Ensure you have appropriate authentication or authorization middleware if you want to restrict access.

If You want Another middleware you can you use in your web.php file.

```
Route::middleware(['web', 'auth'])->group(function () {
    Route::get('/github-pull', [GithubController::class, 'executeCommands'])
        ->name('github.pull');
});
```

Example Workflow
----------------

[](#example-workflow)

1. Configure your `.env` file with your GitHub credentials and repository link.
2. Run the console command or access the web route to pull updates and run migrations/seeds automatically.

Testing
-------

[](#testing)

To test the package locally:

1. Clone the repository and install dependencies: ```
    composer install
    ```
2. Set up a Laravel project with PHP 7.4–8.4 and Laravel 8–11.
3. Configure the environment variables and test the console command and web route.

Contributing
------------

[](#contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Submit a pull request with your changes.

License
-------

[](#license)

This package is open-source software licensed under the [MIT License](LICENSE).

Support
-------

[](#support)

For issues or questions, please open an issue on the [GitHub repository](https://github.com/moh-sagor/github-updater).

Acknowledgments
---------------

[](#acknowledgments)

Developed by Md Sagor Hossain ().

---

### Notes for Customization

[](#notes-for-customization)

- Replace `https://github.com/moh-sagor/github-updater` with your actual GitHub repository URL if it differs.
- If you have additional features, testing instructions, or contributors, add them to the relevant sections.
- If you have a `LICENSE` file, ensure it exists in your repository and matches the MIT License mentioned.

This README is concise, clear, and follows best practices for open-source Laravel packages. You can further expand it with screenshots, more detailed examples, or additional sections like "Changelog" or "Roadmap" if applicable. Let me know if you’d like to adjust or add anything specific!

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance50

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Every ~12 days

Recently: every ~22 days

Total

8

Last Release

365d ago

PHP version history (2 changes)v1.0.0PHP ^7.4|^8.1

v1.0.8PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d211e416041359c99f37b12f9dfd70c1314ea5ae3df4470e15800ac8fc904daa?d=identicon)[moh-sagor](/maintainers/moh-sagor)

---

Top Contributors

[![moh-sagor](https://avatars.githubusercontent.com/u/48994376?v=4)](https://github.com/moh-sagor "moh-sagor (23 commits)")

---

Tags

laravelartisangithubgitupdater

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sagor-github-updater/health.svg)

```
[![Health](https://phpackages.com/badges/sagor-github-updater/health.svg)](https://phpackages.com/packages/sagor-github-updater)
```

###  Alternatives

[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[msztorc/laravel-env

Laravel env helper commands

7855.4k](/packages/msztorc-laravel-env)[laravelplus/laravel-updater

A Laravel package for syncing with upstream repositories (GitHub, GitLab, Bitbucket, etc.)

201.7k](/packages/laravelplus-laravel-updater)

PHPackages © 2026

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