laravel-notification-channels / onesignal

OneSignal notifications channel for Laravel
MIT License
283 stars 119 forks source link

Enable it for php8.1 #143

Open MuhammadSulman opened 2 years ago

MuhammadSulman commented 2 years ago

It's not applicable for the php8.1 version Selection_001 .

robjbrain commented 2 years ago

You can easily create a fork for this.

I've already done it so you can skip steps 1-3 but for the sake of education I included it.

  1. Click "Fork" on github.
  2. Create a new branch called "fix-laravel9" (obviously can be anything)
  3. Edit composer.json to allow php8.1 and laravel 9
  4. Add this to your composer.json
"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/robjbrain/onesignal"
        }
    ],
"require": {
...
"laravel-notification-channels/onesignal": "dev-fix-laravel9"
}
  1. run composer update

Then it will work!

What this is doing is telling composer to look at the forked repo but still use the original name.

You have to use a different branch name and prefix it with "dev". I don't know why that is, presumably hard coded into composer in some way.

teamappelit commented 2 years ago

@robjbrain Thanks for your reply or time and for sharing your knowledge.