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
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([]); |
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
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 |
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
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" |
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
const firebaseConfig = { | |
apiKey: "XXXXXXXX", | |
authDomain: "XXXXXXXX", | |
projectId: "XXXXXXXX", | |
storageBucket: "XXXXXXXX", | |
messagingSenderId: "XXXXXXXX", | |
appId: "XXXXXXXX", | |
measurementId: "XXXXXXXX" | |
}; |
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
npx create-react-app import-demo | |
cd import-demo | |
npm start |
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
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']; |
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
$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), | |
]; | |
}); |
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
return [ | |
'id' => $this->id, | |
'name' => $this->name, | |
'email' => $this->email, | |
'address' => $this->address, | |
'created_at' => Carbon::parse($this->created_at)->toDayDateTimeString(), | |
]; |
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
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(); |
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\Http\Resources\UsersResource; | |
use App\User; | |
use Illuminate\Http\Request; | |
/** | |
* Class UsersController |
NewerOlder