Skip to content

Instantly share code, notes, and snippets.

View madhusudhan1234's full-sized avatar

Madhu Sudhan Subedi madhusudhan1234

View GitHub Profile
import { useEffect, useState } from "react";
import {Navbar, Nav, Form, Button, Table, Container, Modal} from 'react-bootstrap';
import './App.css';
import * as XLSX from "xlsx";
import db from './firebase';
function App() {
const [users, setUsers] = useState([]);
const [show, setShow] = useState(false);
const [headers, setHeaders] = useState([]);
import firebase from 'firebase'
const firebaseConfig = {
apiKey: process.env.REACT_APP_FIREBASE_API_KEY,
authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN,
databaseURL: process.env.REACT_APP_FIREBASE_DATABASE_URL,
projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID,
storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET,
messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,
appId: process.env.REACT_APP_FIREBASE_APP_ID
REACT_APP_FIREBASE_API_KEY = "XXXXXXXX"
REACT_APP_FIREBASE_AUTH_DOMAIN = "XXXXXXXX"
REACT_APP_FIREBASE_DATABASE_URL = "XXXXXXXX"
REACT_APP_FIREBASE_PROJECT_ID = "XXXXXXXX"
REACT_APP_FIREBASE_STORAGE_BUCKET = "XXXXXXXX"
REACT_APP_FIREBASE_MESSAGING_SENDER_ID = "XXXXXXXX"
REACT_APP_FIREBASE_APP_ID = "XXXXXXXX"
const firebaseConfig = {
apiKey: "XXXXXXXX",
authDomain: "XXXXXXXX",
projectId: "XXXXXXXX",
storageBucket: "XXXXXXXX",
messagingSenderId: "XXXXXXXX",
appId: "XXXXXXXX",
measurementId: "XXXXXXXX"
};
npx create-react-app import-demo
cd import-demo
npm start
import React, { Component } from "react";
import DataTable from "./components/DataTable";
export default class ReactDataTableApp extends Component {
constructor(props) {
super(props);
}
render() {
const columns = ['id', 'name', 'email', 'address', 'created_at'];
$factory->define(App\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'address' => $faker->address,
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
];
});
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'address' => $this->address,
'created_at' => Carbon::parse($this->created_at)->toDayDateTimeString(),
];
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('address');
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
<?php
namespace App\Http\Controllers;
use App\Http\Resources\UsersResource;
use App\User;
use Illuminate\Http\Request;
/**
* Class UsersController