mercurius - Laravel 用メッセンジャー" style="max-width: 100%;">
mercuriusは、Laravel と Vue.js を使用したリアルタイム メッセンジャー システムで、Laravel プロジェクトと一緒に簡単にインストールできる完全なアプリケーションを備えています。
mercuriusのデモを試すことができます。次のいずれかの資格情報を使用して認証します。
パスワード: password
ヒント: 2 つの異なるブラウザを開いて、異なるユーザー名でログインすると、メッセージの送受信をテストできます。
続行する前に、Laravel 5.6
以降がインストールされていることを確認してください。
アカウントをお持ちでない場合は、pusher.com Web サイトで無料のアカウントを作成してください。ダッシュボードに移動し、新しいアプリを作成し、API 認証情報をメモします。
次に、API キーを.env
ファイルに追加しましょう。また、 BROADCAST_DRIVER
pusher
に変更します (デフォルトはlog
)。
. . .
BROADCAST_DRIVER =pusher
. . .
PUSHER_APP_ID ="xxxxxx"
PUSHER_APP_KEY ="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_SECRET ="xxxxxxxxxxxxxxxxxxxx"
PUSHER_APP_CLUSTER ="xx"
BroadcastServiceProvider
の登録config/app.php
を開き、行AppProvidersBroadcastServiceProvider::class,
コメントを解除します。
認証がすでに設定されている場合はこの手順をスキップし、それ以外の場合は次のように入力します。
php artisan make:auth
composer require launcher/ mercurius
デフォルトの構成を変更する場合は、次のコマンドを入力して構成ファイルを公開します。
php artisan vendor:publish --tag= mercurius -config
構成を編集するには、 /config/ mercurius .php
を開いて独自の値を追加します。
return [
/*
|--------------------------------------------------------------------------
| mercurius Models
|--------------------------------------------------------------------------
|
| Defines the models used with mercurius , use it to extend mercurius and
| create your own implementation.
|
*/
' models ' => [
' user ' => App User::class,
' messages ' => Launcher mercurius Models Message::class,
],
/*
|--------------------------------------------------------------------------
| User Table Fields
|--------------------------------------------------------------------------
|
| You can specify the column names for the user table. The `name` accepts
| an array of fields, for building custom names with multiple columns.
|
*/
' fields ' => [
// 'name' => ['first_name', 'last_name'],
' name ' => ' name ' ,
' slug ' => ' slug ' ,
' avatar ' => ' avatar ' ,
],
];
php artisan mercurius :install
composer dump-autoload
Launcher mercurius mercurius User
特性をUser
モデルに追加します。
// ...
use Illuminate Foundation Auth User as Authenticatable ;
use Launcher mercurius mercurius User ;
class User extends Authenticatable
{
use mercurius User;
// ...
}
php artisan db:seed --class= mercurius DatabaseSeeder
デモの例のように、システムにメッセージとユーザーを追加します。
デモユーザー:
[email protected]
[email protected]
[email protected]
パスワード: password
mercurius更新するときは、必ずアセットを公開して新しいバージョンの CSS/JS を適用してください。
php artisan vendor:publish --tag= mercurius -public --force
詳細については、「カスタマイズ」を参照してください。
詳細については、ロードマップを確認してください。
詳細については、「貢献」を参照してください。
私たちは変更された情報を含む CHANGELOG を保持します。
著作権 2018 ブルーノ・トリーニャ。 mercurius MIT ライセンスに基づいてリリースされています。