View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
View .htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L] | |
</IfModule> |
View Chat.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Ratchet\MessageComponentInterface; | |
use Ratchet\ConnectionInterface; | |
class Chat implements MessageComponentInterface | |
{ | |
protected $clients; | |
private $activeUsers; | |
private $activeConnections; | |
public function __construct() |
View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
View main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
View chat-server.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() |
View CrudController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\crud; | |
use Illuminate\Http\Request; | |
class CrudController extends Controller | |
{ | |
/** |
View crudModel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use DB; | |
use Illuminate\Database\Eloquent\Model; | |
class crud extends Model | |
{ | |
public function add($data){ |
View show.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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> |
View add.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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> |
OlderNewer