ปรอท - Messenger สำหรับ Laravel" style="max-width: 100%;">
mercurius คือระบบส่งข้อความแบบเรียลไทม์ที่ใช้ Laravel และ Vue.js ซึ่งมีแอปพลิเคชันที่สมบูรณ์ซึ่งคุณสามารถติดตั้งกับโปรเจ็กต์ Laravel ได้อย่างง่ายดาย
คุณสามารถลองสาธิต mercurius ได้ ตรวจสอบสิทธิ์โดยใช้ข้อมูลรับรองต่อไปนี้:
รหัสผ่าน: password
เคล็ดลับ: เปิดเบราว์เซอร์ 2 ตัวและเข้าสู่ระบบด้วยชื่อผู้ใช้ที่แตกต่างกัน เพื่อให้คุณสามารถทดสอบการส่ง/รับข้อความได้
ตรวจสอบให้แน่ใจว่าติดตั้ง Laravel 5.6
+ แล้วก่อนดำเนินการต่อ
หากคุณไม่มีบัญชี ให้สร้างบัญชีฟรีบนเว็บไซต์ pusher.com ไปที่แดชบอร์ด สร้างแอปใหม่และจดบันทึกข้อมูลรับรอง 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
จะเพิ่ม Messages และ Users เข้าสู่ระบบ ดังตัวอย่างตัวอย่าง:
ผู้ใช้สาธิต:
[email protected]
[email protected]
[email protected]
รหัสผ่าน: password
เมื่อใดก็ตามที่คุณอัปเดต mercurius อย่าลืมเผยแพร่เนื้อหาเพื่อใช้ CSS/JS เวอร์ชันใหม่
php artisan vendor:publish --tag= mercurius -public --force
โปรดดูการปรับแต่งสำหรับข้อมูลเพิ่มเติม
ตรวจสอบแผนงานสำหรับข้อมูลเพิ่มเติม
โปรดดูการมีส่วนร่วมสำหรับข้อมูลเพิ่มเติม
เราเก็บ CHANGELOG พร้อมด้วยข้อมูลที่มีการเปลี่ยนแปลง
ลิขสิทธิ์ 2018 บรูโน ตอร์รินญา mercurius ได้รับการเผยแพร่ภายใต้ใบอนุญาต MIT