Laravel 实时聊天
Mercurius is a real-time messenger system using Laravel and Vue.js, featuring a complete application that you can easily install with any Laravel project.
Click thumbs to enlarge image
You can try a demo of Mercurius. Authenticate using any of the following credentials:
Password: password
Tip: Open 2 different browsers and login with different usernames, so you can test send/receiving messages.
Make sure Laravel 5.6+ is installed before proceed.
If you don't have an account, create a free one on pusher.com website. Go to the dashboard, create a new app and take note of the API credentials.
Now, let's add the API keys to the .env file.
Also, change the BROADCAST_DRIVER to pusher (default is log).
...
BROADCAST_DRIVER=pusher
...
PUSHER_APP_ID="xxxxxx"
PUSHER_APP_KEY="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_SECRET="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_CLUSTER="xx"BroadcastServiceProviderOpen config/app.php and uncomment the line App\Providers\BroadcastServiceProvider::class,.
Skip this step if authentication is already setup, otherwise type:
php artisan make:authcomposer require launcher/mercuriusIf you want to change the default configuration, publish the config file, by typing the command:
php artisan vendor:publish --tag=mercurius-configFor editing the config, open /config/mercurius.php and add your own values.
…php artisan mercurius:install
composer dump-autoloadAdd Launcher\Mercurius\MercuriusUser trait to your User model:
// ...
use Illuminate\Foundation\Auth\User as Authenticatable;
use Launcher\Mercurius\MercuriusUser;
class User extends Authenticatable
{
use MercuriusUser;
// ...
}php artisan db:seed --class=MercuriusDatabaseSeederWill add Messages and Users to the system, like in the demo example:
Demo Users:
[email protected][email protected][email protected]Password: password
Whenever you update Mercurius, make sure to publish assets to apply the new versions of CSS/JS.
php artisan vendor:publish --tag=mercurius-public --forcePlease see Customization for more information.
Check the roadmap for more information.
Please see CONTRIBUTING for more information.
We keep a CHANGELOG with the information that has changed.
Copyright 2018 Bruno Torrinha. Mercurius is released under the MIT License.
暂无开放 Issues,或尚未同步最近议题。