Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

laravel 5.7 js folder move #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ If you don't use auto-discovery, add the ServiceProvider to the providers array
PhpJunior\LaravelVideoChat\LaravelVideoChatServiceProvider::class,
```

```php
```php
php artisan vendor:publish --provider="PhpJunior\LaravelVideoChat\LaravelVideoChatServiceProvider"
```

And
```php
And
```php
php artisan migrate
php artisan storage:link

Expand Down Expand Up @@ -69,25 +69,25 @@ Install the JavaScript dependencies:
npm install --save laravel-echo js-cookie vue-timeago socket.io socket.io-client webrtc-adapter vue-chat-scroll
```

If you are running the Socket.IO server on the same domain as your web application, you may access the client library like
If you are running the Socket.IO server on the same domain as your web application, you may access the client library like

```javascript
<script src="//{{ Request::getHost() }}:6001/socket.io/socket.io.js"></script>
```

in your application's `head` HTML element


Next, you will need to instantiate Echo with the `socket.io` connector and a `host`.

```vuejs
require('webrtc-adapter');
window.Cookies = require('js-cookie');

import Echo from "laravel-echo"

window.io = require('socket.io-client');

window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001'
Expand All @@ -98,18 +98,18 @@ Finally, you will need to run a compatible Socket.IO server. Use
[tlaverdure/laravel-echo-server](https://github.com/tlaverdure/laravel-echo-server) GitHub repository.


In `resources/assets/js/app.js` file:
In `resources/js/app.js` file:

```vuejs
import VueChatScroll from 'vue-chat-scroll';
import VueTimeago from 'vue-timeago';

Vue.use(VueChatScroll);
Vue.component('chat-room' , require('./components/laravel-video-chat/ChatRoom.vue'));
Vue.component('group-chat-room', require('./components/laravel-video-chat/GroupChatRoom.vue'));
Vue.component('video-section' , require('./components/laravel-video-chat/VideoSection.vue'));
Vue.component('file-preview' , require('./components/laravel-video-chat/FilePreview.vue'));

Vue.use(VueTimeago, {
name: 'timeago', // component name, `timeago` by default
locale: 'en-US',
Expand Down Expand Up @@ -172,12 +172,12 @@ $conversations = Chat::getAllConversations()
</ul>
```

#### Start Conversation
#### Start Conversation
```php
Chat::startConversationWith($otherUserId);
```

#### Accept Conversation
#### Accept Conversation
```php
Chat::acceptMessageRequest($conversationId);
```
Expand Down Expand Up @@ -209,7 +209,7 @@ Use `$request->all()` for video call.
Chat::startVideoCall($conversationId , $request->all());
```

#### Start Group Conversation
#### Start Group Conversation
```php
Chat::createGroupConversation( $groupName , [ $otherUserId , $otherUserId2 ]);
```
Expand Down
4 changes: 2 additions & 2 deletions src/LaravelVideoChatServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function boot()

$this->publishes([
$this->configPath() => config_path('laravel-video-chat.php'),
$this->componentsPath() => base_path('resources/assets/js/components/laravel-video-chat'),
$this->componentsPath() => base_path('resources/js/components/laravel-video-chat'),
]);

$this->loadMigrationsFrom($this->migrationsPath());
Expand Down Expand Up @@ -135,7 +135,7 @@ protected function migrationsPath()
*/
protected function componentsPath()
{
return __DIR__.'/../resources/assets/js/components';
return __DIR__.'/../resources/js/components';
}

/**
Expand Down