Skip to content

Instantly share code, notes, and snippets.

View harendra21's full-sized avatar
🏠
Working from home

Harendra Kumar Kanojiya harendra21

🏠
Working from home
View GitHub Profile
@harendra21
harendra21 / index.html
Created February 18, 2019 10:47
Angular
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="./assets/style.css">
<title>Angular Firbase Crud App</title>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<?php
namespace App;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
class Chat implements MessageComponentInterface
{
protected $clients;
private $activeUsers;
private $activeConnections;
public function __construct()
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Ratchet WebSocket Chat Sample</title>
<link rel="stylesheet" href="./assets/node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="./assets/node_modules/bootstrap/dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="./assets/css/bootflat.min.css">
<link rel="stylesheet" href="./assets/css/style.css">
</head>
var conn = new WebSocket('ws://localhost:8080');
var name;
conn.onopen = function (e) {
console.log("Connec tion established!");
};
function getTime() {
var date = new Date();
return date.toLocaleDateString()
<?php
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
use App\Chat;
require dirname(__DIR__) . '/vendor/autoload.php';
$server = IoServer::factory(
new HttpServer(
new WsServer(
new Chat()
<?php
namespace App\Http\Controllers;
use App\crud;
use Illuminate\Http\Request;
class CrudController extends Controller
{
/**
<?php
namespace App;
use DB;
use Illuminate\Database\Eloquent\Model;
class crud extends Model
{
public function add($data){
@include('parts/header')
<div class="row">
<div class="col show table-responsive">
<table class="table table-stripped table-bordered ">
<thead>
<tr>
<th>S.No.</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
@include('parts/header')
<div class="row">
<div class="col">
<form class="form-group form" action="{{ url('/') }}/add-update-record" method ='POST' >
<div class="form-group">
@if (!empty($user) && !empty($user->id))
<input type="hidden" name="userId" value="{{ $user->id }}">
@endif
<label>First Name : </label>
<input type="text" name="fName" class="form-control" id="_fName" @if (!empty($user->first_name)) value="{{ $user->first_name }}" @else value={{old('fName')}} @endif>