PHP code example of ashfaq1701 / laravel-chat

1. Go to this page and download the library: Download ashfaq1701/laravel-chat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ashfaq1701 / laravel-chat example snippets


'providers' => [
    ...
    Codemash\Socket\SocketServiceProvider::class,
    Ashfaq1701\LaravelChat\Providers\LaravelChatServiceProvider::class,
],

'providers' => [
    ...
    App\Providers\ChatEventServiceProvider::class,
],

'aliases' => [
    ...
    'Socket' => Codemash\Socket\Facades\Socket::class,
    'Chat' => Ashfaq1701\LaravelChat\Facades\Chat::class,
]

public function run()
{
    $this->call(UserTableSeeder::class);
    $this->call(ChannelsUsersTableSeeder::class);
}

...
use Ashfaq1701\LaravelChat\Traits\Chattable;

class User extends Authenticatable
{
	use Chattable;
	...

class VerifyCsrfToken extends BaseVerifier
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
    	'/uploads/file'
    ];
}

	...
	@yield('content')
    <!-- JavaScripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js" integrity="sha384-I6F5OKECLVtK/BL+8iSLDEHowSAfUo76ZL9+kGAgTRdiByINKJaqTPH/QVNS1VDb" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
    {{-- <script src="{{ elixir('js/app.js') }}"></script> --}}
    @yield('custom-scripts')
</body>
</html>

sh
php artisan vendor:publish
sh
php artisan migrate
sh
php artisan db:seed
sh
php artisan socket:listen
sh
php artisan serve
sh
nohup php artisan socket:listen &