Coder Social home page Coder Social logo

pusher-http-laravel's Introduction

DEPRECATED

Laravel now has built-in support for Pusher Channels. This is now the recommended approach to integrate Channels into a Laravel project.

Currently, Pusher will continue to review any PRs and solve security vulnerabilities in this SDK, but will not be making any major improvements going forward.

Pusher Channels Laravel Library

A Pusher Channels bridge for Laravel. Formerly vinkla/pusher.

// Triggering events.
$pusher->trigger('my-channel', 'my_event', 'hello world');

// Authenticating Private channels.
$pusher->socket_auth('my-channel', 'socket_id');

// Want to use the facade?
Pusher::get('/channels');

Build Status StyleCI Coverage Status Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require pusher/pusher-http-laravel

Add the service provider to config/app.php in the providers array. If you're using Laravel 5.5 or greater, there's no need to do this.

Pusher\Laravel\PusherServiceProvider::class

If you want you can use the facade. Add the reference in config/app.php to your aliases array.

'Pusher' => Pusher\Laravel\Facades\Pusher::class

Configuration

The Laravel Channels SDK requires connection configuration. To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish --provider="Pusher\Laravel\PusherServiceProvider"

This will create a config/pusher.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

Default Connection Name

This option default is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is main.

Channels Connections

This option connections is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like.

Encrypted Channels

To enable end to end encrypted channels, you need to uncomment a line from the Channels config file

'app_id' => env('APP_ID'),
'options' => [
    'cluster' => env('APP_CLUSTER'),
    'encryption_master_key' => env('ENCRYPTION_MASTER_KEY'),
],
'host' => null,
'port' => null,

Then you need to set an encryption_master_key in your .env file. You should then be able to publish encrypted events to channels prefixed with private-encrypted and you can validate this is working by checking the (dashboard)[https://dashboard.pusher.com] debug console for your app!

Usage

PusherManager

This is the class of most interest. It is bound to the ioc container as pusher and can be accessed using the Facades\Pusher facade. This class implements the ManagerInterface by extending AbstractManager. The interface and abstract class are both part of Graham Campbell's Laravel Manager package, so you may want to go and checkout the docs for how to use the manager class over at that repository. Note that the connection class returned will always be an instance of Pusher.

Facades\Pusher

This facade will dynamically pass static method calls to the pusher object in the ioc container which by default is the PusherManager class.

PusherServiceProvider

This class contains no public methods of interest. This class should be added to the providers array in config/app.php. This class will setup ioc bindings.

Examples

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is main. After you enter your authentication details in the config file, it will just work:

// You can alias this in config/app.php.
use Pusher\Laravel\Facades\Pusher;

Pusher::trigger('my-channel', 'my-event', ['message' => $message]);
// We're done here - how easy was that, it just works!

Pusher::getSettings();
// This example is simple and there are far more methods available.

The PusherManager will behave like it is a Pusher. If you want to call specific connections, you can do that with the connection method:

use Pusher\Laravel\Facades\Pusher;

// Writing this…
Pusher::connection('main')->log('They see me logging…');

// …is identical to writing this
Pusher::log('They hatin…');

// and is also identical to writing this.
Pusher::connection()->log('Tryin to catch me testing dirty…');

// This is because the main connection is configured to be the default.
Pusher::getDefaultConnection(); // This will return main.

// We can change the default connection.
Pusher::setDefaultConnection('alternative'); // The default is now alternative.

If you prefer to use dependency injection over facades like me, then you can inject the manager:

use Pusher\Laravel\PusherManager;

class Foo
{
    protected $pusher;

    public function __construct(PusherManager $pusher)
    {
        $this->pusher = $pusher;
    }

    public function bar()
    {
        $this->pusher->trigger('my-channel', 'my-event', ['message' => $message]);
    }
}

App::make('Foo')->bar();

Documentation

There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of the official Channels package.

License

MIT © Pusher

pusher-http-laravel's People

Contributors

ce-brex avatar grahamcampbell avatar kn100 avatar lloople avatar omranic avatar readmecritic avatar shalvah avatar vinkla avatar willsewell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pusher-http-laravel's Issues

Pusher::trigger always false in laravel 5.6

how to solve?

Pusher::trigger('test-chat', 'test-msg', ['user' => 'tester', 'text' => 'test']);

42 'main' => [
43 'auth_key' => env('PUSHER_APP_KEY'),
44 'secret' => env('PUSHER_APP_SECRET'),
45 'app_id' => env('PUSHER_APP_ID'),
46 'options' => [
47 'debug' => true,
48 'cluster' => env('PUSHER_APP_CLUSTER'),
49 'encrypted' => false
50 ],
51 'host' => null,
52 'port' => null,
53 'timeout

Class 'Pusher\Pusher' not found

Since the last update i get this error

Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Pusher\Pusher' not found in D:\Xampp7\htdocs\cookme\vendor\vinkla\pusher\src\PusherFactory.php:79

Installation Failed on Laravel 5.8

Installation Failed, Laravel 5.8

- don't install illuminate/http v5.5.41|don't install laravel/framework v5.8.10
- don't install illuminate/http v5.5.43|don't install laravel/framework v5.8.10
- don't install illuminate/http v5.5.44|don't install laravel/framework v5.8.10
- Installation request for laravel/framework (locked at v5.8.10,
required as 5.8.*) -> satisfiable by laravel/framework[v5.8.10].

Edit: Weirdly Works Now

Class 'Pusher\Laravel\PusherServiceProvider' not found

hello i want to ask, whats the problem with my code ? i used laravel 5.3.2 and pusher/pusher-http-laravel 2.3.0

in array providers
Pusher\Laravel\PusherServiceProvider::class,

in array aliases
'Pusher' => Pusher\Laravel\Facades\Pusher::class,

[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Pusher\Laravel\PusherServiceProvider' not found

I can not install this package in laravel 5.4

c:\xampp\htdocs\mymusic (master)
λ composer require vinkla/pusher
Using version ^2.4 for vinkla/pusher
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- vinkla/pusher 2.5.0 requires php ^7.0 -> your PHP version (5.6.30) does not satisfy that requirement.
- Installation request for vinkla/pusher ^2.4 -> satisfiable by vinkla/pusher[2.4.0, 2.5.0].
- Conclusion: remove laravel/framework v5.4.15
- Conclusion: don't install laravel/framework v5.4.15
- vinkla/pusher 2.4.0 requires illuminate/contracts 5.1.* || 5.2.* || 5.3.* -> satisfiable by illuminate/contracts[v5.1.1, v5.1.13, v5.1.16, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4].
- don't install illuminate/contracts v5.1.1|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.13|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.16|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.20|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.22|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.25|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.28|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.30|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.31|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.41|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.1.8|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.0|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.19|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.21|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.24|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.25|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.26|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.27|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.28|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.31|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.32|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.37|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.43|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.45|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.6|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.2.7|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.3.0|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.3.16|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.3.23|don't install laravel/framework v5.4.15
- don't install illuminate/contracts v5.3.4|don't install laravel/framework v5.4.15
- Installation request for laravel/framework (locked at v5.4.15, required as 5.4.*) -> satisfiable by laravel/framework[v5.4.15].

Installation failed, reverting ./composer.json to its original content.

Unknown auth_key

Why did I always get "Unknown auth_key" error? I can ensure that my app_key is right.

Set up the new GitHub Hook for Packagist

Pusher-http-laravel composer github integration is going to break in early 2019. Worth fixing now. Error "This package is using the legacy GitHub service and will stop being auto-updated in early 2019. Please set up the new GitHub Hook for Packagist so that it keeps working in the future."

Support for cluster name

Hello there !

Pusher is setting up some clusters on different regions. Since I live in France I would like to use the eu but have no option to set it. Could you please tell me if it is planned or not (yet) ?

See the doc : https://pusher.com/docs/clusters

Thank you !

What's the best way to set up Pusher logging with the Laravel Pusher bridge?

I'm running a Building Real-Time Laravel Apps with Pusher workshop at Laracon EU. Yipee! As part of that I wanted to show how you have two approaches to using Pusher:

  1. Using this bridge library
  2. Using the Pusher Event Broadcaster

So that developers are more directly interacting with a Pusher instance I'm going to make the majority of the workshop use the bridge. One thing I want to do is hook up the internal Pusher PHP library logging to the Laravel logging. I'm trying to work out the best way of doing that using the bridge.

Right now my solution is to add logging into the AppServiceProvider->boot() function:

namespace App\Providers;

use Illuminate\Support\Facades\Log; // added
use Illuminate\Support\ServiceProvider;

// Added simple logger proxy
class LaravelLoggerProxy {
    public function log( $msg ) {
        Log::info($msg);
    }
}

class AppServiceProvider extends ServiceProvider
{

    public function boot()
    {
        $pusher = $this->app->make('pusher');
        $pusher->set_logger( new LaravelLoggerProxy() );
    }

  // ...

My question: would it be worth adding a standard way of doing this to the bridge library?

Any ideas or opinions would be very much appreciated. I'd be happy to submit a PR to this library once a "best approach" is decided.

Note: work on v3.0 is in planning, but we don't have an ETA

Error Using the Facade

The error below has been reported by @alexandredes and @mottihoresh. This error occurs when using the Facade. As I've learned, using dependency injection it works.

call_user_func_array() expects parameter 1 to be a valid callback

I've tried this in my local setup, using Homestead, with both the Facade and dependency injection without any problems. The events gets registered in the console at http://pusher.com. Example code below.

<?php namespace App\Http\Controllers;

use Vinkla\Pusher\Facades\Pusher;

class PushController extends Controller {

    public function index()
    {
        dd(Pusher::trigger('my-channel', 'my-event', ['message' => 'A']));
    }

}

unnamed

If someone else experience this, please report it here. If you have a solution, please share it!

Inconsistent Triggering Events

$pusher = new \Pusher\Pusher(
      'xxxxxxxxxxxxxxx',
      'xxxxxxxxxxxxxxx',
      'xxxxx',
      $options
    );

$available_channels = ['a', 'b', 'c'];
$ret_notif = [
        'message' => "New Notification.",
        'status' => true
      ];
$pusher->trigger($available_channels, 'my-event', $ret_notif);

basically this is a snippet of how I trigger my notifications to different channels. So the issue is it gets very inconsistent, some days it works and some days it doesn't. And I can see the analytics on the dashboard that there is activity going on though the frontend is listening to the channels or is subscribed to them but it's not receiving anything when the notification should be triggered. Is there any reason behind this? But when I test it locally it works perfectly.

Is there any new updates, syntax, or flows I should be aware of?

Method 'trigger' not found in class \Vinkla\Pusher\PusherManager

Well, I decided to give this package another go with Laravel 5.1. Not sure what the issue is. None of the Pusher SDK methods are available when I try your dependency injection method.

use Vinkla\Pusher\PusherManager;

class Foo
{
    protected $pusher;

    public function __construct(PusherManager $pusher)
    {
        $this->pusher = $pusher;
    }

    public function bar()
    {
        $this->pusher->trigger('my-channel', 'my-event', ['message' => $message]);
    }
}

Anyway to fix this so autocompletion will work?

Pusher beams integration

This package offers a wrapper around pusher-http-laravel, it has a notify function that sends a notification a native notification via the Push Notifications Api, as this is going to be replaced, would it be convenient wrapping push-notifications-php aswell and reusing this method (or adding a new one) but keeping this wrapper package or do you consider that it would be better making a new wrapper just for push-notifications? I can help with both if needed.

publish package

Configuration
This will create a config/pusher.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

I was stuck with 'This' . I found eventually to run php artisan vendor:publish then the pusher.php file appeared in the app/config folder. Please change the readme?

Error on installing on Laravel 5.4

When I try to install puser-http-laravel I get the following error:

Using version ^4.0 for pusher/pusher-http-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for pusher/pusher-http-laravel ^4.0 -> satisfiable by pusher/pusher-http-laravel[v4.0.0].
- Conclusion: remove laravel/framework v5.4.36
- Conclusion: don't install laravel/framework v5.4.36
- pusher/pusher-http-laravel v4.0.0 requires illuminate/support 5.5.* -> satisfiable by illuminate/support[v5.5.0, v5.5.16, v5.5.17, v5.5.2].
- don't install illuminate/support v5.5.0|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.16|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.17|don't install laravel/framework v5.4.36
- don't install illuminate/support v5.5.2|don't install laravel/framework v5.4.36
- Installation request for laravel/framework (locked at v5.4.36, required as 5.4.*) -> satisfiable by laravel/framework[v5.4.36].

This is my composer.json file:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.1",
"alexpechkarev/google-maps": "1.0.8",
"cviebrock/eloquent-sluggable": "4.2.5",
"hipsterjazzbo/landlord": "^2.0",
"laracasts/flash": "^3.0",
"laravel/framework": "5.4.",
"laravel/passport": "^4.0",
"laravel/tinker": "~1.0",
"laravelcollective/html": "^5.2.0",
"musonza/chat": "^2.0",
"santigarcor/laratrust": "5.0.
",
"yajra/laravel-datatables-oracle": "^7.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"platform": {
"php": "7.1.1"
}
}
}

Install error on laravel 5.6

Fresh installation of Laravel 5.6.3, it looks like illuminate/contracts should be pumped up and probably illuminate/support too.

> composer require pusher/pusher-http-laravel
Using version ^4.0 for pusher/pusher-http-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove laravel/framework v5.6.3
    - Conclusion: don't install laravel/framework v5.6.3
    - pusher/pusher-http-laravel 4.0.x-dev requires illuminate/contracts 5.5.* -> satisfiable by illuminate/contracts[5.5.x-dev, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - pusher/pusher-http-laravel v4.0.0 requires illuminate/contracts 5.5.* -> satisfiable by illuminate/contracts[5.5.x-dev, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - don't install illuminate/contracts 5.5.x-dev|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.0|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.16|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.17|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.2|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.28|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.33|don't install laravel/framework v5.6.3
    - don't install illuminate/contracts v5.5.34|don't install laravel/framework v5.6.3
    - Installation request for laravel/framework (locked at v5.6.3, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.3].
    - Installation request for pusher/pusher-http-laravel ^4.0 -> satisfiable by pusher/pusher-http-laravel[4.0.x-dev, v4.0.0].


Installation failed, reverting ./composer.json to its original content.

Presence channel not return wrong auth string.

I'm trying to build a presence channel. But the auth string returned is not correct.

Here is the back end code:

class pusherController extends Controller
{

    protected $pusher;

    public function __construct(PusherManager $pusher)
    {
        $this->pusher = $pusher;
    }

    public function pusherPinyinAuth(Request $request)
    {
        if($request->user()) {
            $user = $request->user();
            $auth= $this->pusher->presence_auth($request->input('channel_name'),$request->input('socket_id'), $user->id, array('h'=>'user_info'));
            return response($auth);
        }
    }
}

Error message

Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":null,"message":"Auth value for subscription to presence-5 is invalid: should be of format 'key:signature'"}}}

I guess the the error is caused by the additional ':' added before the auth string. Here is my string output:

{auth: ":8dacf362f8fe62bae42c33dfe5511d3d1c42144685d5843a6a6a8014490ed0f6",…}

Pusher cluster for Cameroon-Africa

I saw in the documentation that the cluster where for specific regions or countries.
Is there a cluster for Cameroon an African country?
Or can we use the eu cluster?

Using Pusher Notify does not work

Hi,

First, thank you for making this package - it's great.

Second, I'm trying to use your package with Pusher's notify function for Push Notifications, but when I try

Pusher::notify(['channel'],
  ['apns' => [
    'aps' => [
      'alert' => [
        'body' =>'message'
      ],
    ],
  ]
]);

Nothing happens and I'm wondering if you can help guide me to the correct way, if I'm doing something wrong.

thanks

pusher-http-laravel not compatible with Laravel v6.0.3

Hi there,
When I try to install pusher-http-laravel at laravel last version (6.0.3), I faced this erro.


Problem 1
 - Conclusion: remove laravel/framework v6.0.3
 - Conclusion: don't install laravel/framework v6.0.3
 - pusher/pusher-http-laravel v4.2.0 requires illuminate/support 5.5.*

image

add Arabic text on image using GD PHP

At first, I have an image (card). I want to fill data card from the database using GD PHP to add text and merge QR code, no problem with merge QR code image. put the problem in adding Arabic text.

`public function exportCards(){
header('Content-type: image/png; charset=utf8');

// Create Image From Existing File
$jpg_image = imagecreatefrompng(asset('/images/card.png'));

// Allocate A Color For The Text
$white = imagecolorallocate($jpg_image, 0, 0, 0);

// Set Path to Font File
putenv('GDFONTPATH=' . realpath('.') . '/assets/');
$font_path = 'arial';

// Set Text to Be Printed On Image
$text = "";

// Print Text On Image

$text = "سمير سالم";
imagettftext($jpg_image, 12, 0, 50, 196, $white, $font_path, $text);
imagettftext($jpg_image, 12, 0, 50, 235, $white, $font_path, '400653210');
imagettftext($jpg_image, 12, 0, 50, 273, $white, $font_path, '500');
imagettftext($jpg_image, 12, 0, 50, 310, $white, $font_path, 'Senaaa');
imagettftext($jpg_image, 12, 0, 50, 347, $white, $font_path, 'SEN');
$imageName = time();
QrCode::format('png')->backgroundColor(222, 222, 246)->generate('Make me into a QrCode!', $_SERVER['DOCUMENT_ROOT'].'/oxfam/images/qrcode/'.$imageName.'.png');
$src = imagecreatefrompng(asset('/images/qrcode/'.$imageName.'.png'));
$thumb = imagecreatetruecolor(100, 100);

imagecopyresized($thumb, $src, 0, 0, 0, 0, 320, 300, 100, 100);
imagecopymerge($jpg_image, $thumb, 510, 200, 0, 0, 100, 99, 75);
$image = imagecreatetruecolor(700, 450);
imagecopy($image, $jpg_image, 0 ,0, 0,0, 700, 450);
imagepng($image, $_SERVER['DOCUMENT_ROOT'].'/oxfam/images/cards/'.time().'.png');

// Send Image to Browser
imagepng($jpg_image);
// Clear Memory
imagedestroy($jpg_image);

}`

result ( ر ي م س م ل ا س)

class 'Vinkla\Pusher\Facades\Pusher' does not have a method 'socket_auth'

Hello,

I don't arrive to implementing the auth endpoint for a private channel. The response is: class 'Vinkla\Pusher\Facades\Pusher' does not have a method 'socket_auth'

My code:

class UserController extends Controller
{
    protected $pusher;

    public function __construct(PusherManager $pusher)
    {
        $this->pusher = $pusher;
    }

    public function getAuthPusher()
    {
        $auth = $this->pusher->socket_auth($_POST['channel_name'], $_POST['socket_id']);
    }
}

Thank you for your help :)

Install error on laravel 5.4

composer require pusher/pusher-http-laravel
Using version ^4.0 for pusher/pusher-http-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for pusher/pusher-http-laravel ^4.0 -> satisfiable by pusher/pusher-http-laravel[v4.0.0].
    - Conclusion: remove laravel/framework v5.4.36
    - Conclusion: don't install laravel/framework v5.4.36
    - pusher/pusher-http-laravel v4.0.0 requires illuminate/contracts 5.5.* -> satisfiable by illuminate/contracts[v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34].
    - don't install illuminate/contracts v5.5.0|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.16|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.17|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.2|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.28|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.33|don't install laravel/framework v5.4.36
    - don't install illuminate/contracts v5.5.34|don't install laravel/framework v5.4.36
    - Installation request for laravel/framework (locked at v5.4.36, required as 5.4.*) -> satisfiable by laravel/framework[v5.4.36].


Installation failed, reverting ./composer.json to its original content.

My php version is 7.1.11. Is this package no longer support laravel 5.4 ? because i saw that this package dropped support for laravel 5.4.

cannot sign up in pusher website

hi. i cannot creat account in pusher website. it gives me this error:
An unexpected error occurred. Please try again

i tried creating account with google, github and by filling the form. but its not working totally

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.