mercurius - Laravel용 메신저" style="max-width: 100%;">
mercurius 는 Laravel과 Vue.js를 사용하는 실시간 메신저 시스템으로, 모든 Laravel 프로젝트와 함께 쉽게 설치할 수 있는 완전한 애플리케이션을 갖추고 있습니다.
mercurius 데모를 사용해 볼 수 있습니다. 다음 자격 증명 중 하나를 사용하여 인증합니다.
비밀번호: password
팁: 2개의 다른 브라우저를 열고 다른 사용자 이름으로 로그인하면 메시지 보내기/받기를 테스트할 수 있습니다.
계속 진행하기 전에 Laravel 5.6
이상이 설치되어 있는지 확인하세요.
계정이 없다면 pusher.com 웹사이트에서 무료 계정을 만드세요. 대시보드로 이동하여 새 앱을 만들고 API 자격 증명을 기록해 둡니다.
이제 .env
파일에 API 키를 추가해 보겠습니다. 또한 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 라이센스에 따라 출시됩니다.