commit
b724da5482
7196 changed files with 686837 additions and 0 deletions
@ -0,0 +1,439 @@ |
|||||||
|
-- |
||||||
|
-- PostgreSQL database dump |
||||||
|
-- |
||||||
|
|
||||||
|
-- Dumped from database version 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1) |
||||||
|
-- Dumped by pg_dump version 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1) |
||||||
|
|
||||||
|
SET statement_timeout = 0; |
||||||
|
SET lock_timeout = 0; |
||||||
|
SET idle_in_transaction_session_timeout = 0; |
||||||
|
SET client_encoding = 'UTF8'; |
||||||
|
SET standard_conforming_strings = on; |
||||||
|
SELECT pg_catalog.set_config('search_path', '', false); |
||||||
|
SET check_function_bodies = false; |
||||||
|
SET xmloption = content; |
||||||
|
SET client_min_messages = warning; |
||||||
|
SET row_security = off; |
||||||
|
|
||||||
|
SET default_tablespace = ''; |
||||||
|
|
||||||
|
SET default_table_access_method = heap; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.failed_jobs ( |
||||||
|
id bigint NOT NULL, |
||||||
|
connection text NOT NULL, |
||||||
|
queue text NOT NULL, |
||||||
|
payload text NOT NULL, |
||||||
|
exception text NOT NULL, |
||||||
|
failed_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.failed_jobs OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE SEQUENCE public.failed_jobs_id_seq |
||||||
|
START WITH 1 |
||||||
|
INCREMENT BY 1 |
||||||
|
NO MINVALUE |
||||||
|
NO MAXVALUE |
||||||
|
CACHE 1; |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.failed_jobs_id_seq OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER SEQUENCE public.failed_jobs_id_seq OWNED BY public.failed_jobs.id; |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: ris; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.ris ( |
||||||
|
id bigint NOT NULL, |
||||||
|
code character varying(255) NOT NULL, |
||||||
|
antibiotic character varying(255) NOT NULL, |
||||||
|
status character varying(255) NOT NULL, |
||||||
|
specimen character varying(255) NOT NULL, |
||||||
|
pathogen character varying(255) NOT NULL, |
||||||
|
age character varying(255) NOT NULL, |
||||||
|
country character varying(255) NOT NULL, |
||||||
|
year integer NOT NULL, |
||||||
|
sex character varying(255) NOT NULL, |
||||||
|
value integer NOT NULL, |
||||||
|
created_at timestamp(0) without time zone, |
||||||
|
updated_at timestamp(0) without time zone |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.ris OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: irsxes_id_seq; Type: SEQUENCE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE SEQUENCE public.irsxes_id_seq |
||||||
|
START WITH 1 |
||||||
|
INCREMENT BY 1 |
||||||
|
NO MINVALUE |
||||||
|
NO MAXVALUE |
||||||
|
CACHE 1; |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.irsxes_id_seq OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: irsxes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER SEQUENCE public.irsxes_id_seq OWNED BY public.ris.id; |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.migrations ( |
||||||
|
id integer NOT NULL, |
||||||
|
migration character varying(255) NOT NULL, |
||||||
|
batch integer NOT NULL |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.migrations OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE SEQUENCE public.migrations_id_seq |
||||||
|
AS integer |
||||||
|
START WITH 1 |
||||||
|
INCREMENT BY 1 |
||||||
|
NO MINVALUE |
||||||
|
NO MAXVALUE |
||||||
|
CACHE 1; |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.migrations_id_seq OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id; |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: password_resets; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.password_resets ( |
||||||
|
email character varying(255) NOT NULL, |
||||||
|
token character varying(255) NOT NULL, |
||||||
|
created_at timestamp(0) without time zone |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.password_resets OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.sample_files ( |
||||||
|
id bigint NOT NULL, |
||||||
|
code character varying(255) NOT NULL, |
||||||
|
specimen character varying(255) NOT NULL, |
||||||
|
age character varying(255) NOT NULL, |
||||||
|
country character varying(255) NOT NULL, |
||||||
|
year integer NOT NULL, |
||||||
|
sex character varying(255) NOT NULL, |
||||||
|
value integer NOT NULL, |
||||||
|
created_at timestamp(0) without time zone, |
||||||
|
updated_at timestamp(0) without time zone |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.sample_files OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files_id_seq; Type: SEQUENCE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE SEQUENCE public.sample_files_id_seq |
||||||
|
START WITH 1 |
||||||
|
INCREMENT BY 1 |
||||||
|
NO MINVALUE |
||||||
|
NO MAXVALUE |
||||||
|
CACHE 1; |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.sample_files_id_seq OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER SEQUENCE public.sample_files_id_seq OWNED BY public.sample_files.id; |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users; Type: TABLE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE TABLE public.users ( |
||||||
|
id bigint NOT NULL, |
||||||
|
uid character varying(20) NOT NULL, |
||||||
|
name character varying(255) NOT NULL, |
||||||
|
email character varying(255) NOT NULL, |
||||||
|
username character varying(255) NOT NULL, |
||||||
|
sex character varying(1) NOT NULL, |
||||||
|
email_verified_at timestamp(0) without time zone, |
||||||
|
role character varying(20) NOT NULL, |
||||||
|
password character varying(255) NOT NULL, |
||||||
|
remember_token character varying(100), |
||||||
|
created_at timestamp(0) without time zone, |
||||||
|
updated_at timestamp(0) without time zone, |
||||||
|
change_pass character varying(255) |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.users OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE SEQUENCE public.users_id_seq |
||||||
|
START WITH 1 |
||||||
|
INCREMENT BY 1 |
||||||
|
NO MINVALUE |
||||||
|
NO MAXVALUE |
||||||
|
CACHE 1; |
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE public.users_id_seq OWNER TO classic; |
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id; |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs id; Type: DEFAULT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.failed_jobs ALTER COLUMN id SET DEFAULT nextval('public.failed_jobs_id_seq'::regclass); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations id; Type: DEFAULT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.migrations ALTER COLUMN id SET DEFAULT nextval('public.migrations_id_seq'::regclass); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: ris id; Type: DEFAULT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.ris ALTER COLUMN id SET DEFAULT nextval('public.irsxes_id_seq'::regclass); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files id; Type: DEFAULT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.sample_files ALTER COLUMN id SET DEFAULT nextval('public.sample_files_id_seq'::regclass); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users id; Type: DEFAULT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: failed_jobs; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.failed_jobs (id, connection, queue, payload, exception, failed_at) FROM stdin; |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: migrations; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.migrations (id, migration, batch) FROM stdin; |
||||||
|
2 2014_10_12_100000_create_password_resets_table 1 |
||||||
|
3 2019_08_19_000000_create_failed_jobs_table 1 |
||||||
|
4 2020_06_18_083204_create_irsxes_table 1 |
||||||
|
6 2020_06_18_083413_create_sample_files_table 2 |
||||||
|
9 2014_10_12_000000_create_users_table 3 |
||||||
|
10 2020_06_19_083211_add_change_pass_column 4 |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: password_resets; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.password_resets (email, token, created_at) FROM stdin; |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: ris; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.ris (id, code, antibiotic, status, specimen, pathogen, age, country, year, sex, value, created_at, updated_at) FROM stdin; |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: sample_files; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.sample_files (id, code, specimen, age, country, year, sex, value, created_at, updated_at) FROM stdin; |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
COPY public.users (id, uid, name, email, username, sex, email_verified_at, role, password, remember_token, created_at, updated_at, change_pass) FROM stdin; |
||||||
|
10 9oGYI5q1bOZV82iEyCcz Selemani Ally seleman_ally@yahoo.com sele m 2020-06-19 12:27:03 Admin $2y$10$31hHmeQv.na8THE4lPo.M.nZbQU6Z0.bhonyMKwmdNooL48T6deNq \N 2020-06-19 12:19:32 2020-06-19 12:27:42 2020-06-19 12:27:42 |
||||||
|
14 fP8LO1BK4ZhFtHaxPIRp John Farrow john@eshift.org john m 2020-06-21 06:19:17 Staff $2y$10$KrO0MgBylJL3YlPNYkuuDuSXoQuObDDn25Y2ET/5DYLLzf7xBZXFy \N 2020-06-21 06:15:00 2020-06-21 06:19:39 2020-06-21 06:19:39 |
||||||
|
13 nsPXtO7Kvnr1H16OL8ZZ David Hagan david.hagan@eshift.org hagand m 2020-06-21 20:23:42 Admin $2y$10$GC1MFvjAcVG0s3Sz1vtKoeIsLg5rF5wxS.pAihuKxdt39Xu4h7swS \N 2020-06-21 06:10:20 2020-06-21 20:24:46 2020-06-21 20:24:46 |
||||||
|
16 xUTUzawc3PTqzEzwCxni William Ngosa ngosawilliam@gmail.com wngosa m 2020-06-24 08:47:10 Admin $2y$10$6rYItXpH85uOm3wXQXFnkeXx7rtcnskzgI2LjTPkkeOqjKtp59z3G \N 2020-06-24 08:46:07 2020-06-24 08:48:11 2020-06-24 08:48:11 |
||||||
|
\. |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
SELECT pg_catalog.setval('public.failed_jobs_id_seq', 1, false); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: irsxes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
SELECT pg_catalog.setval('public.irsxes_id_seq', 184924, true); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
SELECT pg_catalog.setval('public.migrations_id_seq', 10, true); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files_id_seq; Type: SEQUENCE SET; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
SELECT pg_catalog.setval('public.sample_files_id_seq', 2926, true); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
SELECT pg_catalog.setval('public.users_id_seq', 17, true); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: failed_jobs failed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.failed_jobs |
||||||
|
ADD CONSTRAINT failed_jobs_pkey PRIMARY KEY (id); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: ris irsxes_pkey; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.ris |
||||||
|
ADD CONSTRAINT irsxes_pkey PRIMARY KEY (id); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.migrations |
||||||
|
ADD CONSTRAINT migrations_pkey PRIMARY KEY (id); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: sample_files sample_files_pkey; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.sample_files |
||||||
|
ADD CONSTRAINT sample_files_pkey PRIMARY KEY (id); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.users |
||||||
|
ADD CONSTRAINT users_email_unique UNIQUE (email); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.users |
||||||
|
ADD CONSTRAINT users_pkey PRIMARY KEY (id); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users users_uid_unique; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.users |
||||||
|
ADD CONSTRAINT users_uid_unique UNIQUE (uid); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: users users_username_unique; Type: CONSTRAINT; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
ALTER TABLE ONLY public.users |
||||||
|
ADD CONSTRAINT users_username_unique UNIQUE (username); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- Name: password_resets_email_index; Type: INDEX; Schema: public; Owner: classic |
||||||
|
-- |
||||||
|
|
||||||
|
CREATE INDEX password_resets_email_index ON public.password_resets USING btree (email); |
||||||
|
|
||||||
|
|
||||||
|
-- |
||||||
|
-- PostgreSQL database dump complete |
||||||
|
-- |
||||||
|
|
@ -0,0 +1,172 @@ |
|||||||
|
library(RPostgreSQL) |
||||||
|
library(rlang) |
||||||
|
library(plyr) |
||||||
|
library(dplyr) |
||||||
|
library(DBI) |
||||||
|
library(RCurl) |
||||||
|
|
||||||
|
con <- dbConnect(PostgreSQL(), dbname = 'np_glass', host = 'xxxxxxxx', port = 5432, user = 'xxxxxx', password = 'xxxxxxx') |
||||||
|
|
||||||
|
glass <- getURL(paste0("https://ohp.staging.np.amr.health/api/29/analytics/events/aggregate/wsHfxYEgte5.csv?dimension=ou:isF1Ffne2Ik&dimension=pe:THIS_YEAR;LAST_5_YEARS&dimension=opkhFoeEz9m:IN:eco;sal&dimension=DYsNDR4nCWB&dimension=TRm4iaYikdK-oPyVHCMErH0&dimension=NoTuZ3jydbw:IN:ur;bl&dimension=JkrGmcLg6Zm.gaCDwmKm768&dimension=JkrGmcLg6Zm.C25kY3E21zv&stage=JkrGmcLg6Zm&displayProperty=NAME&outputType=EVENT&outputIdScheme=CODE"), userpwd="api:Pa55word!", httpauth = 1L) |
||||||
|
glass <- read.table(text = glass, sep =",", header = TRUE, stringsAsFactors = FALSE) |
||||||
|
|
||||||
|
glass |
||||||
|
|
||||||
|
# Renaming the header |
||||||
|
names(glass)[1] <- "pathogen" |
||||||
|
names(glass)[2] <- "sex" |
||||||
|
names(glass)[3] <- "age" |
||||||
|
names(glass)[4] <- "specimen" |
||||||
|
names(glass)[5] <- "antibiotic" |
||||||
|
names(glass)[6] <- "status" |
||||||
|
names(glass)[7] <- "country" |
||||||
|
names(glass)[8] <- "year" |
||||||
|
names(glass)[9] <- "value" |
||||||
|
|
||||||
|
# Replace NA with blank |
||||||
|
glass <- glass %>% replace(., is.na(.), "") |
||||||
|
|
||||||
|
# Replacing null status by replacing with X |
||||||
|
glass <- glass %>% mutate(status = ifelse(status == '', 'X', status)) |
||||||
|
|
||||||
|
# Replacing null age with UNK |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == '', 'UNK', age)) |
||||||
|
|
||||||
|
# Changing gender with capital latter |
||||||
|
glass <- glass %>% mutate(sex = ifelse(sex == 'f', 'F', sex)) |
||||||
|
glass <- glass %>% mutate(sex = ifelse(sex == 'm', 'M', sex)) |
||||||
|
glass <- glass %>% mutate(sex = ifelse(sex == '', 'UNK', sex)) |
||||||
|
|
||||||
|
# glass |
||||||
|
|
||||||
|
# Renaming age from uid to code |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'y6vwuHXxddO', '<1', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'jf5Zr4sleyX', '01<04', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'VUF8eXjrbjC', '05<14', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'LF7HNYtqIr5', '15<24', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'T51pNS4GE9a', '25<34', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'eQslOKgf0Wp', '35<44', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'G2ur1JRd6uL', '45<54', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'Dh89WgJK9vt', '55<64', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'dGbMkILwzzN', '65<74', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'Z6eawM1m33G', '75<84', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == 'VKJhxU3XeVU', '85<', age)) |
||||||
|
glass <- glass %>% mutate(age = ifelse(age == '', 'UNK', age)) |
||||||
|
|
||||||
|
glass |
||||||
|
|
||||||
|
# # Renaming specimen |
||||||
|
glass <- glass %>% mutate(specimen = ifelse(specimen == 'bl', 'BLOOD', specimen)) |
||||||
|
glass <- glass %>% mutate(specimen = ifelse(specimen == 'ur', 'URINE', specimen)) |
||||||
|
# glass <- glass %>% mutate(specimen = ifelse(specimen == 'st', 'STOOL', specimen)) |
||||||
|
# glass <- glass %>% mutate(specimen = ifelse(specimen == 'gn', 'GENITAL', specimen)) |
||||||
|
|
||||||
|
glass$code = paste(glass$pathogen, glass$specimen, glass$sex, glass$age, glass$antibiotic, glass$year, sep="=") |
||||||
|
|
||||||
|
glass |
||||||
|
|
||||||
|
# year <- tail(glass$year, 1) |
||||||
|
glass_unique <- paste0(unlist(unique(glass$year)), collapse = ',') |
||||||
|
# glass_unique <- unique(glass_unique) |
||||||
|
# glass_unique <- paste0(unlist(glass_unique), collapse = ',') |
||||||
|
|
||||||
|
glass_unique |
||||||
|
|
||||||
|
# //////////////---------------- Sample file starting -------------///////////////////// |
||||||
|
|
||||||
|
Sample_file <- getURL(paste0("https://ohp.staging.np.amr.health/api/29/analytics/events/aggregate/wsHfxYEgte5.csv?dimension=ou:isF1Ffne2Ik&dimension=pe:THIS_YEAR;LAST_5_YEARS&dimension=JkrGmcLg6Zm.DYsNDR4nCWB&dimension=JkrGmcLg6Zm.TRm4iaYikdK-oPyVHCMErH0&dimension=JkrGmcLg6Zm.NoTuZ3jydbw:IN:ur;bl&stage=JkrGmcLg6Zm&displayProperty=NAME&outputType=EVENT&outputIdScheme=CODE"), userpwd="api:Pa55word!", httpauth = 1L) |
||||||
|
Sample_file <- read.table(text = Sample_file, sep =",", header = TRUE, stringsAsFactors = FALSE) |
||||||
|
|
||||||
|
Sample_file |
||||||
|
|
||||||
|
|
||||||
|
# Renaming the header |
||||||
|
names(Sample_file)[1] <- "sex" |
||||||
|
names(Sample_file)[2] <- "age" |
||||||
|
names(Sample_file)[3] <- "specimen" |
||||||
|
names(Sample_file)[4] <- "country" |
||||||
|
names(Sample_file)[5] <- "year" |
||||||
|
names(Sample_file)[6] <- "value" |
||||||
|
|
||||||
|
# Replacing null age with UNK |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == '', 'UNK', age)) |
||||||
|
|
||||||
|
# Changing gender with capital latter |
||||||
|
Sample_file <- Sample_file %>% mutate(sex = ifelse(sex == 'f', 'F', sex)) |
||||||
|
Sample_file <- Sample_file %>% mutate(sex = ifelse(sex == 'm', 'M', sex)) |
||||||
|
Sample_file <- Sample_file %>% mutate(sex = ifelse(sex == '', 'UNK', sex)) |
||||||
|
|
||||||
|
# Renaming age from uid to code |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'y6vwuHXxddO', '<1', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'jf5Zr4sleyX', '01<04', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'VUF8eXjrbjC', '05<14', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'LF7HNYtqIr5', '15<24', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'T51pNS4GE9a', '25<34', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'eQslOKgf0Wp', '35<44', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'G2ur1JRd6uL', '45<54', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'Dh89WgJK9vt', '55<64', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'dGbMkILwzzN', '65<74', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'Z6eawM1m33G', '75<84', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == 'VKJhxU3XeVU', '85<', age)) |
||||||
|
Sample_file <- Sample_file %>% mutate(age = ifelse(age == '', 'UNK', age)) |
||||||
|
|
||||||
|
# # Renaming specimen |
||||||
|
Sample_file <- Sample_file %>% mutate(specimen = ifelse(specimen == 'bl', 'BLOOD', specimen)) |
||||||
|
Sample_file <- Sample_file %>% mutate(specimen = ifelse(specimen == 'ur', 'URINE', specimen)) |
||||||
|
Sample_file <- Sample_file %>% mutate(specimen = ifelse(specimen == 'st', 'STOOL', specimen)) |
||||||
|
Sample_file <- Sample_file %>% mutate(specimen = ifelse(specimen == 'gn', 'GENITAL', specimen)) |
||||||
|
|
||||||
|
Sample_file$code = paste(Sample_file$specimen, Sample_file$sex, Sample_file$age, Sample_file$year, sep="=") |
||||||
|
|
||||||
|
Sample_file |
||||||
|
|
||||||
|
# ========================PROCCESSING==================== |
||||||
|
|
||||||
|
# RIS starting execution ---------------------------------- |
||||||
|
delete_RIS_data <- function(glass_unique){ |
||||||
|
|
||||||
|
query <- paste("delete from ris where year in ", paste("(", glass_unique, ")")) |
||||||
|
# query <- paste("delete from irsxes where year in 2015, 2016") |
||||||
|
dbSendQuery(con, query) |
||||||
|
|
||||||
|
print('========= RIS REPORT =========') |
||||||
|
msg <- paste("Successfully deleted RIS data for: ", glass_unique) |
||||||
|
print(msg) |
||||||
|
} |
||||||
|
|
||||||
|
# Save to database |
||||||
|
insert_RIS_data <- function(){ |
||||||
|
dbWriteTable(con, name = 'ris', value = as.data.frame(glass), row.names = FALSE, append = TRUE) |
||||||
|
msg <- paste("Successfully uploaded RIS data for: ", glass_unique) |
||||||
|
print(msg) |
||||||
|
} |
||||||
|
|
||||||
|
delete_RIS_data(glass_unique) |
||||||
|
insert_RIS_data() |
||||||
|
# ========================== END for RIS ================================ |
||||||
|
|
||||||
|
# Sample file starting execution ---------------------------------- |
||||||
|
delete_SF_data <- function(glass_unique){ |
||||||
|
query <- paste("delete from sample_files where year in ", paste("(", glass_unique, ")")) |
||||||
|
dbSendQuery(con, query) |
||||||
|
|
||||||
|
print('========= SAMPLE FILE REPORT =========') |
||||||
|
msg <- paste("Successfully deleted Sample File data for: ", glass_unique) |
||||||
|
print(msg) |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
# Save to database |
||||||
|
insert_SF_data <- function(){ |
||||||
|
myquery <- dbWriteTable(con, name = 'sample_files', value = as.data.frame(Sample_file), row.names = FALSE, append = TRUE) |
||||||
|
msg <- paste("Successfully uploaded Sample File data for: ", glass_unique) |
||||||
|
print(msg) |
||||||
|
} |
||||||
|
|
||||||
|
delete_SF_data(glass_unique) |
||||||
|
insert_SF_data() |
||||||
|
# ========================== END for Sample file ================================ |
||||||
|
|
||||||
|
|
||||||
|
dbDisconnect(con) |
||||||
|
|
@ -0,0 +1,15 @@ |
|||||||
|
root = true |
||||||
|
|
||||||
|
[*] |
||||||
|
charset = utf-8 |
||||||
|
end_of_line = lf |
||||||
|
insert_final_newline = true |
||||||
|
indent_style = space |
||||||
|
indent_size = 4 |
||||||
|
trim_trailing_whitespace = true |
||||||
|
|
||||||
|
[*.md] |
||||||
|
trim_trailing_whitespace = false |
||||||
|
|
||||||
|
[*.{yml,yaml}] |
||||||
|
indent_size = 2 |
@ -0,0 +1,46 @@ |
|||||||
|
APP_NAME=Laravel |
||||||
|
APP_ENV=local |
||||||
|
APP_KEY= |
||||||
|
APP_DEBUG=true |
||||||
|
APP_URL=http://localhost |
||||||
|
|
||||||
|
LOG_CHANNEL=stack |
||||||
|
|
||||||
|
DB_CONNECTION=mysql |
||||||
|
DB_HOST=127.0.0.1 |
||||||
|
DB_PORT=3306 |
||||||
|
DB_DATABASE=laravel |
||||||
|
DB_USERNAME=root |
||||||
|
DB_PASSWORD= |
||||||
|
|
||||||
|
BROADCAST_DRIVER=log |
||||||
|
CACHE_DRIVER=file |
||||||
|
QUEUE_CONNECTION=sync |
||||||
|
SESSION_DRIVER=file |
||||||
|
SESSION_LIFETIME=120 |
||||||
|
|
||||||
|
REDIS_HOST=127.0.0.1 |
||||||
|
REDIS_PASSWORD=null |
||||||
|
REDIS_PORT=6379 |
||||||
|
|
||||||
|
MAIL_MAILER=smtp |
||||||
|
MAIL_HOST=smtp.mailtrap.io |
||||||
|
MAIL_PORT=2525 |
||||||
|
MAIL_USERNAME=null |
||||||
|
MAIL_PASSWORD=null |
||||||
|
MAIL_ENCRYPTION=null |
||||||
|
MAIL_FROM_ADDRESS=null |
||||||
|
MAIL_FROM_NAME="${APP_NAME}" |
||||||
|
|
||||||
|
AWS_ACCESS_KEY_ID= |
||||||
|
AWS_SECRET_ACCESS_KEY= |
||||||
|
AWS_DEFAULT_REGION=us-east-1 |
||||||
|
AWS_BUCKET= |
||||||
|
|
||||||
|
PUSHER_APP_ID= |
||||||
|
PUSHER_APP_KEY= |
||||||
|
PUSHER_APP_SECRET= |
||||||
|
PUSHER_APP_CLUSTER=mt1 |
||||||
|
|
||||||
|
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" |
||||||
|
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
@ -0,0 +1,5 @@ |
|||||||
|
* text=auto |
||||||
|
*.css linguist-vendored |
||||||
|
*.scss linguist-vendored |
||||||
|
*.js linguist-vendored |
||||||
|
CHANGELOG.md export-ignore |
@ -0,0 +1,12 @@ |
|||||||
|
/node_modules |
||||||
|
/public/hot |
||||||
|
/public/storage |
||||||
|
/storage/*.key |
||||||
|
/vendor |
||||||
|
.env |
||||||
|
.env.backup |
||||||
|
.phpunit.result.cache |
||||||
|
Homestead.json |
||||||
|
Homestead.yaml |
||||||
|
npm-debug.log |
||||||
|
yarn-error.log |
@ -0,0 +1,21 @@ |
|||||||
|
<IfModule mod_rewrite.c> |
||||||
|
<IfModule mod_negotiation.c> |
||||||
|
Options -MultiViews -Indexes |
||||||
|
</IfModule> |
||||||
|
|
||||||
|
RewriteEngine On |
||||||
|
|
||||||
|
# Handle Authorization Header |
||||||
|
RewriteCond %{HTTP:Authorization} . |
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
||||||
|
|
||||||
|
# Redirect Trailing Slashes If Not A Folder... |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d |
||||||
|
RewriteCond %{REQUEST_URI} (.+)/$ |
||||||
|
RewriteRule ^ %1 [L,R=301] |
||||||
|
|
||||||
|
# Send Requests To Front Controller... |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f |
||||||
|
RewriteRule ^ index.php [L] |
||||||
|
</IfModule> |
@ -0,0 +1,13 @@ |
|||||||
|
php: |
||||||
|
preset: laravel |
||||||
|
disabled: |
||||||
|
- unused_use |
||||||
|
finder: |
||||||
|
not-name: |
||||||
|
- index.php |
||||||
|
- server.php |
||||||
|
js: |
||||||
|
finder: |
||||||
|
not-name: |
||||||
|
- webpack.mix.js |
||||||
|
css: true |
@ -0,0 +1,79 @@ |
|||||||
|
<p align="center"><img src="https://res.cloudinary.com/dtfbvvkyp/image/upload/v1566331377/laravel-logolockup-cmyk-red.svg" width="400"></p> |
||||||
|
|
||||||
|
<p align="center"> |
||||||
|
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a> |
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a> |
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a> |
||||||
|
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a> |
||||||
|
</p> |
||||||
|
|
||||||
|
## About Laravel |
||||||
|
|
||||||
|
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: |
||||||
|
|
||||||
|
- [Simple, fast routing engine](https://laravel.com/docs/routing). |
||||||
|
- [Powerful dependency injection container](https://laravel.com/docs/container). |
||||||
|
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. |
||||||
|
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). |
||||||
|
- Database agnostic [schema migrations](https://laravel.com/docs/migrations). |
||||||
|
- [Robust background job processing](https://laravel.com/docs/queues). |
||||||
|
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). |
||||||
|
|
||||||
|
Laravel is accessible, powerful, and provides tools required for large, robust applications. |
||||||
|
|
||||||
|
## Learning Laravel |
||||||
|
|
||||||
|
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. |
||||||
|
|
||||||
|
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. |
||||||
|
|
||||||
|
## Laravel Sponsors |
||||||
|
|
||||||
|
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell). |
||||||
|
|
||||||
|
- **[Vehikl](https://vehikl.com/)** |
||||||
|
- **[Tighten Co.](https://tighten.co)** |
||||||
|
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** |
||||||
|
- **[64 Robots](https://64robots.com)** |
||||||
|
- **[Cubet Techno Labs](https://cubettech.com)** |
||||||
|
- **[Cyber-Duck](https://cyber-duck.co.uk)** |
||||||
|
- **[Many](https://www.many.co.uk)** |
||||||
|
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)** |
||||||
|
- **[DevSquad](https://devsquad.com)** |
||||||
|
- [UserInsights](https://userinsights.com) |
||||||
|
- [Fragrantica](https://www.fragrantica.com) |
||||||
|
- [SOFTonSOFA](https://softonsofa.com/) |
||||||
|
- [User10](https://user10.com) |
||||||
|
- [Soumettre.fr](https://soumettre.fr/) |
||||||
|
- [CodeBrisk](https://codebrisk.com) |
||||||
|
- [1Forge](https://1forge.com) |
||||||
|
- [TECPRESSO](https://tecpresso.co.jp/) |
||||||
|
- [Runtime Converter](http://runtimeconverter.com/) |
||||||
|
- [WebL'Agence](https://weblagence.com/) |
||||||
|
- [Invoice Ninja](https://www.invoiceninja.com) |
||||||
|
- [iMi digital](https://www.imi-digital.de/) |
||||||
|
- [Earthlink](https://www.earthlink.ro/) |
||||||
|
- [Steadfast Collective](https://steadfastcollective.com/) |
||||||
|
- [We Are The Robots Inc.](https://watr.mx/) |
||||||
|
- [Understand.io](https://www.understand.io/) |
||||||
|
- [Abdel Elrafa](https://abdelelrafa.com) |
||||||
|
- [Hyper Host](https://hyper.host) |
||||||
|
- [Appoly](https://www.appoly.co.uk) |
||||||
|
- [OP.GG](https://op.gg) |
||||||
|
- [云软科技](http://www.yunruan.ltd/) |
||||||
|
|
||||||
|
## Contributing |
||||||
|
|
||||||
|
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). |
||||||
|
|
||||||
|
## Code of Conduct |
||||||
|
|
||||||
|
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). |
||||||
|
|
||||||
|
## Security Vulnerabilities |
||||||
|
|
||||||
|
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. |
||||||
|
|
||||||
|
## License |
||||||
|
|
||||||
|
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). |
@ -0,0 +1,41 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Console; |
||||||
|
|
||||||
|
use Illuminate\Console\Scheduling\Schedule; |
||||||
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; |
||||||
|
|
||||||
|
class Kernel extends ConsoleKernel |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The Artisan commands provided by your application. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $commands = [ |
||||||
|
// |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* Define the application's command schedule. |
||||||
|
* |
||||||
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
protected function schedule(Schedule $schedule) |
||||||
|
{ |
||||||
|
// $schedule->command('inspire')->hourly(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Register the commands for the application. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
protected function commands() |
||||||
|
{ |
||||||
|
$this->load(__DIR__.'/Commands'); |
||||||
|
|
||||||
|
require base_path('routes/console.php'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,55 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Exceptions; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
||||||
|
use Throwable; |
||||||
|
|
||||||
|
class Handler extends ExceptionHandler |
||||||
|
{ |
||||||
|
/** |
||||||
|
* A list of the exception types that are not reported. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $dontReport = [ |
||||||
|
// |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* A list of the inputs that are never flashed for validation exceptions. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $dontFlash = [ |
||||||
|
'password', |
||||||
|
'password_confirmation', |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* Report or log an exception. |
||||||
|
* |
||||||
|
* @param \Throwable $exception |
||||||
|
* @return void |
||||||
|
* |
||||||
|
* @throws \Exception |
||||||
|
*/ |
||||||
|
public function report(Throwable $exception) |
||||||
|
{ |
||||||
|
parent::report($exception); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Render an exception into an HTTP response. |
||||||
|
* |
||||||
|
* @param \Illuminate\Http\Request $request |
||||||
|
* @param \Throwable $exception |
||||||
|
* @return \Symfony\Component\HttpFoundation\Response |
||||||
|
* |
||||||
|
* @throws \Throwable |
||||||
|
*/ |
||||||
|
public function render($request, Throwable $exception) |
||||||
|
{ |
||||||
|
return parent::render($request, $exception); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use Illuminate\Foundation\Auth\ConfirmsPasswords; |
||||||
|
|
||||||
|
class ConfirmPasswordController extends Controller |
||||||
|
{ |
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Confirm Password Controller |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This controller is responsible for handling password confirmations and |
||||||
|
| uses a simple trait to include the behavior. You're free to explore |
||||||
|
| this trait and override any functions that require customization. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
use ConfirmsPasswords; |
||||||
|
|
||||||
|
/** |
||||||
|
* Where to redirect users when the intended url fails. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
protected $redirectTo = RouteServiceProvider::HOME; |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new controller instance. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware('auth'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; |
||||||
|
|
||||||
|
class ForgotPasswordController extends Controller |
||||||
|
{ |
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Password Reset Controller |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This controller is responsible for handling password reset emails and |
||||||
|
| includes a trait which assists in sending these notifications from |
||||||
|
| your application to your users. Feel free to explore this trait. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
use SendsPasswordResetEmails; |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use Illuminate\Foundation\Auth\AuthenticatesUsers; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
|
||||||
|
class LoginController extends Controller |
||||||
|
{ |
||||||
|
use AuthenticatesUsers; |
||||||
|
|
||||||
|
/** |
||||||
|
* Where to redirect users after login. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
// protected $redirectTo = RouteServiceProvider::HOME; |
||||||
|
protected $redirectTo = ''; |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new controller instance. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware('guest')->except('logout'); |
||||||
|
} |
||||||
|
|
||||||
|
public function username() |
||||||
|
{ |
||||||
|
return 'username'; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,73 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use App\User; |
||||||
|
use Illuminate\Foundation\Auth\RegistersUsers; |
||||||
|
use Illuminate\Support\Facades\Hash; |
||||||
|
use Illuminate\Support\Facades\Validator; |
||||||
|
|
||||||
|
class RegisterController extends Controller |
||||||
|
{ |
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Register Controller |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This controller handles the registration of new users as well as their |
||||||
|
| validation and creation. By default this controller uses a trait to |
||||||
|
| provide this functionality without requiring any additional code. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
use RegistersUsers; |
||||||
|
|
||||||
|
/** |
||||||
|
* Where to redirect users after registration. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
protected $redirectTo = RouteServiceProvider::HOME; |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new controller instance. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware('guest'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Get a validator for an incoming registration request. |
||||||
|
* |
||||||
|
* @param array $data |
||||||
|
* @return \Illuminate\Contracts\Validation\Validator |
||||||
|
*/ |
||||||
|
protected function validator(array $data) |
||||||
|
{ |
||||||
|
return Validator::make($data, [ |
||||||
|
'name' => ['required', 'string', 'max:255'], |
||||||
|
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
||||||
|
'password' => ['required', 'string', 'min:8', 'confirmed'], |
||||||
|
]); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new user instance after a valid registration. |
||||||
|
* |
||||||
|
* @param array $data |
||||||
|
* @return \App\User |
||||||
|
*/ |
||||||
|
protected function create(array $data) |
||||||
|
{ |
||||||
|
return User::create([ |
||||||
|
'name' => $data['name'], |
||||||
|
'email' => $data['email'], |
||||||
|
'password' => Hash::make($data['password']), |
||||||
|
]); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use Illuminate\Foundation\Auth\ResetsPasswords; |
||||||
|
|
||||||
|
class ResetPasswordController extends Controller |
||||||
|
{ |
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Password Reset Controller |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This controller is responsible for handling password reset requests |
||||||
|
| and uses a simple trait to include this behavior. You're free to |
||||||
|
| explore this trait and override any methods you wish to tweak. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
use ResetsPasswords; |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* Where to redirect users after resetting their password. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
// protected $redirectTo = RouteServiceProvider::HOME; |
||||||
|
protected $redirectTo = '/'; |
||||||
|
} |
@ -0,0 +1,43 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth; |
||||||
|
|
||||||
|
use App\Http\Controllers\Controller; |
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use Illuminate\Foundation\Auth\VerifiesEmails; |
||||||
|
|
||||||
|
class VerificationController extends Controller |
||||||
|
{ |
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Email Verification Controller |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This controller is responsible for handling email verification for any |
||||||
|
| user that recently registered with the application. Emails may also |
||||||
|
| be re-sent if the user didn't receive the original email message. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
use VerifiesEmails; |
||||||
|
|
||||||
|
/** |
||||||
|
* Where to redirect users after verification. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
// protected $redirectTo = RouteServiceProvider::HOME; |
||||||
|
protected $redirectTo = '/'; |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new controller instance. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware('auth'); |
||||||
|
$this->middleware('signed')->only('verify'); |
||||||
|
$this->middleware('throttle:6,1')->only('verify', 'resend'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Carbon; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
use Illuminate\Support\Facades\Hash; |
||||||
|
|
||||||
|
class ChangePasswordController extends Controller |
||||||
|
{ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware(['auth', 'verified']); |
||||||
|
// ->except(['create', 'store']) |
||||||
|
} |
||||||
|
// |
||||||
|
public function index(){ |
||||||
|
|
||||||
|
return view('auth.change_pass'); |
||||||
|
} |
||||||
|
|
||||||
|
public function upt_pass(Request $request){ |
||||||
|
|
||||||
|
$validatedData = $request->validate([ |
||||||
|
'current_password' => 'required', |
||||||
|
'password' => 'required|string|min:6|confirmed', |
||||||
|
]); |
||||||
|
|
||||||
|
if (!(Hash::check($request->get('current_password'), Auth::user()->password))) { |
||||||
|
// The passwords matches |
||||||
|
return redirect()->back()->with("error","Your current password does not matches with the password you provided. Please try again."); |
||||||
|
} |
||||||
|
|
||||||
|
if(strcmp($request->get('current_password'), $request->get('password')) == 0){ |
||||||
|
//Current password and new password are same |
||||||
|
return redirect()->back()->with("error","New Password cannot be same as your current password. Please choose a different password."); |
||||||
|
} |
||||||
|
|
||||||
|
//Change Password |
||||||
|
$user = Auth::user(); |
||||||
|
$user->password = Hash::make($request->input('password')); |
||||||
|
$user->change_pass = Carbon::now(); |
||||||
|
$user->save(); |
||||||
|
|
||||||
|
// return "good"; |
||||||
|
|
||||||
|
return redirect()->route('sample_file')->with("success","Password successfully changed !"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; |
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs; |
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests; |
||||||
|
use Illuminate\Routing\Controller as BaseController; |
||||||
|
|
||||||
|
class Controller extends BaseController |
||||||
|
{ |
||||||
|
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use Illuminate\Http\Request; |
||||||
|
|
||||||
|
class HomeController extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Create a new controller instance. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware('auth'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Show the application dashboard. |
||||||
|
* |
||||||
|
* @return \Illuminate\Contracts\Support\Renderable |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
return view('home'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,97 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\irsx; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Carbon; |
||||||
|
use Illuminate\Support\Facades\DB; |
||||||
|
|
||||||
|
class IrsxController extends Controller |
||||||
|
{ |
||||||
|
|
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware(['auth', 'pass']); |
||||||
|
// ->except(['create', 'store']) |
||||||
|
} |
||||||
|
|
||||||
|
public function index(){ |
||||||
|
|
||||||
|
// $date1 = Carbon::now()->subYear()->format('Y'); |
||||||
|
$date1 = Carbon::now()->format('Y'); |
||||||
|
// print($date1); |
||||||
|
$date = (!empty($_GET["date"])) ? ($_GET["date"]) : ($date1); |
||||||
|
$sex = (!empty($_GET["gender"])) ? ($_GET["gender"]) : 'all'; |
||||||
|
|
||||||
|
$data = irsx::distinct()->orderBy('year', 'desc')->get(['year']); |
||||||
|
if(!empty($_GET["gender"]) OR !empty($_GET["date"])){ |
||||||
|
|
||||||
|
if(($sex != 'all') AND ($date != 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, pathogen, age, specimen, antibiotic, |
||||||
|
SUM(value) FILTER (WHERE status='R') AS Resistance, |
||||||
|
SUM(value) FILTER (WHERE status='I') AS Intermidiate, |
||||||
|
SUM(value) FILTER (WHERE status='S') AS Susceptable, |
||||||
|
SUM(value) FILTER (WHERE status='X') AS None, |
||||||
|
SUM(value) FILTER (WHERE status='NS') AS ns |
||||||
|
FROM ris |
||||||
|
where year = '$date' and sex = '$sex' |
||||||
|
GROUP BY country, year, sex, pathogen, age, specimen, antibiotic"); |
||||||
|
} |
||||||
|
|
||||||
|
elseif(($sex == 'all') AND ($date != 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, pathogen, age, specimen, antibiotic, |
||||||
|
SUM(value) FILTER (WHERE status='R') AS Resistance, |
||||||
|
SUM(value) FILTER (WHERE status='I') AS Intermidiate, |
||||||
|
SUM(value) FILTER (WHERE status='S') AS Susceptable, |
||||||
|
SUM(value) FILTER (WHERE status='X') AS None, |
||||||
|
SUM(value) FILTER (WHERE status='NS') AS ns |
||||||
|
FROM ris |
||||||
|
where year = '$date' |
||||||
|
GROUP BY country, year, sex, pathogen, age, specimen, antibiotic"); |
||||||
|
} |
||||||
|
|
||||||
|
elseif(($sex != 'all') AND ($date == 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, pathogen, age, specimen, antibiotic, |
||||||
|
SUM(value) FILTER (WHERE status='R') AS Resistance, |
||||||
|
SUM(value) FILTER (WHERE status='I') AS Intermidiate, |
||||||
|
SUM(value) FILTER (WHERE status='S') AS Susceptable, |
||||||
|
SUM(value) FILTER (WHERE status='X') AS None, |
||||||
|
SUM(value) FILTER (WHERE status='NS') AS ns |
||||||
|
FROM ris |
||||||
|
where sex = '$sex' |
||||||
|
GROUP BY country, year, sex, pathogen, age, specimen, antibiotic"); |
||||||
|
} |
||||||
|
else{ |
||||||
|
$result = DB::select("SELECT country, year, sex, pathogen, age, specimen, antibiotic, |
||||||
|
SUM(value) FILTER (WHERE status='R') AS Resistance, |
||||||
|
SUM(value) FILTER (WHERE status='I') AS Intermidiate, |
||||||
|
SUM(value) FILTER (WHERE status='S') AS Susceptable, |
||||||
|
SUM(value) FILTER (WHERE status='X') AS None, |
||||||
|
SUM(value) FILTER (WHERE status='NS') AS ns |
||||||
|
FROM ris |
||||||
|
GROUP BY country, year, sex, pathogen, age, specimen, antibiotic"); |
||||||
|
} |
||||||
|
} else{ |
||||||
|
$result = DB::select("SELECT country, year, sex, pathogen, age, specimen, antibiotic, |
||||||
|
SUM(value) FILTER (WHERE status='R') AS Resistance, |
||||||
|
SUM(value) FILTER (WHERE status='I') AS Intermidiate, |
||||||
|
SUM(value) FILTER (WHERE status='S') AS Susceptable, |
||||||
|
SUM(value) FILTER (WHERE status='X') AS None, |
||||||
|
SUM(value) FILTER (WHERE status='NS') AS ns |
||||||
|
FROM ris |
||||||
|
where year = '$date' |
||||||
|
GROUP BY country, year, sex, pathogen, age, specimen, antibiotic"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// return $result; |
||||||
|
return view('pages.risx') |
||||||
|
->with('risx', $result) |
||||||
|
->with('data', $data) |
||||||
|
->with('date', $date) |
||||||
|
->with('sex', $sex); |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,83 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\User; |
||||||
|
use App\admin_record; |
||||||
|
use Illuminate\Support\Str; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Facades\Hash; |
||||||
|
use phpDocumentor\Reflection\DocBlock\Tags\Uses; |
||||||
|
|
||||||
|
class adminController extends Controller |
||||||
|
{ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware(['auth', 'admin',]); |
||||||
|
// ->except(['create', 'store']) |
||||||
|
} |
||||||
|
|
||||||
|
public function index(){ |
||||||
|
$user = User::get()->sortByDesc('id'); |
||||||
|
return view('auth.index')->with('user', $user); |
||||||
|
} |
||||||
|
|
||||||
|
public function create(){ |
||||||
|
return view('auth.register'); |
||||||
|
} |
||||||
|
|
||||||
|
public function save(Request $request){ |
||||||
|
$request->validate([ |
||||||
|
'full_name' => 'required|string|min:6', |
||||||
|
'email' => 'required|email|unique:users', |
||||||
|
'username' => 'required|min:4|unique:users', |
||||||
|
'Gender' => 'required', |
||||||
|
'role' => 'required', |
||||||
|
]); |
||||||
|
|
||||||
|
$user = new User; |
||||||
|
$user->uid = str::random(20); |
||||||
|
$user->name = $request['full_name']; |
||||||
|
$user->email = $request['email']; |
||||||
|
$user->username = $request['username']; |
||||||
|
$user->sex = $request['Gender']; |
||||||
|
$user->role = $request['role']; |
||||||
|
$user->password = Hash::make($request['password']); |
||||||
|
$user->save(); |
||||||
|
|
||||||
|
return redirect()->route('register-home'); |
||||||
|
} |
||||||
|
|
||||||
|
public function edit($id){ |
||||||
|
$data = User::where('uid', $id)->first(); |
||||||
|
return view('auth.edit')->with('user', $data); |
||||||
|
} |
||||||
|
|
||||||
|
public function update(Request $request, $id){ |
||||||
|
$request->validate([ |
||||||
|
'full_name' => 'required|string|min:6', |
||||||
|
// 'email' => 'required|email|unique:users', |
||||||
|
// 'username' => 'required|min:4|unique:users', |
||||||
|
'Gender' => 'required', |
||||||
|
'role' => 'required', |
||||||
|
]); |
||||||
|
|
||||||
|
$user = User::find($id); |
||||||
|
|
||||||
|
$user->name = $request['full_name']; |
||||||
|
$user->email = $request['email']; |
||||||
|
$user->username = $request['username']; |
||||||
|
$user->sex = $request['Gender']; |
||||||
|
$user->role = $request['role']; |
||||||
|
// $user->email = $request['email']; |
||||||
|
$user->save(); |
||||||
|
|
||||||
|
return redirect()->route('register-home'); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
public function delete($id){ |
||||||
|
User::find($id)->delete(); |
||||||
|
return redirect()->back()->with('success','Successfully Staff deleted'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,81 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use App\User; |
||||||
|
use App\sample_file; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
use Illuminate\Support\Carbon; |
||||||
|
use Illuminate\Support\Facades\DB; |
||||||
|
use phpDocumentor\Reflection\Types\Null_; |
||||||
|
|
||||||
|
class sample_fileController extends Controller |
||||||
|
{ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->middleware(['auth', 'verified', 'pass']); |
||||||
|
// ->except(['create', 'store']) |
||||||
|
} |
||||||
|
|
||||||
|
public function index(Request $request){ |
||||||
|
// $date1 = null; |
||||||
|
// $date1 = Carbon::now()->subYear()->format('Y'); |
||||||
|
$date1 = Carbon::now()->format('Y'); |
||||||
|
$date = (!empty($_GET["date"])) ? ($_GET["date"]) : ($date1); |
||||||
|
$sex = (!empty($_GET["gender"])) ? ($_GET["gender"]) : 'all'; |
||||||
|
|
||||||
|
// return $sex.' '.$date; |
||||||
|
|
||||||
|
$data = sample_file::distinct()->orderBy('year', 'desc')->get(['year']); |
||||||
|
|
||||||
|
// $sex = 'm'; |
||||||
|
|
||||||
|
|
||||||
|
if(!empty($_GET["gender"]) OR !empty($_GET["date"])){ |
||||||
|
|
||||||
|
if(($sex != 'all') AND ($date != 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, age, specimen, |
||||||
|
SUM(value) AS value |
||||||
|
FROM sample_files |
||||||
|
WHERE sex = '$sex' AND year = '$date' |
||||||
|
GROUP BY country, year, sex, age, specimen "); |
||||||
|
} |
||||||
|
|
||||||
|
elseif(($sex == 'all') AND ($date != 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, age, specimen, |
||||||
|
SUM(value) AS value |
||||||
|
FROM sample_files |
||||||
|
WHERE year = '$date' |
||||||
|
GROUP BY country, year, sex, age, specimen "); |
||||||
|
} |
||||||
|
|
||||||
|
elseif(($sex != 'all') AND ($date == 'all')){ |
||||||
|
$result = DB::select("SELECT country, year, sex, age, specimen, |
||||||
|
SUM(value) AS value |
||||||
|
FROM sample_files |
||||||
|
WHERE sex = '$sex' |
||||||
|
GROUP BY country, year, sex, age, specimen "); |
||||||
|
} |
||||||
|
else{ |
||||||
|
$result = DB::select("SELECT country, year, sex, age, specimen, |
||||||
|
SUM(value) AS value |
||||||
|
FROM sample_files |
||||||
|
GROUP BY country, year, sex, age, specimen "); |
||||||
|
} |
||||||
|
} else{ |
||||||
|
$result = DB::select("SELECT country, year, sex, age, specimen, |
||||||
|
SUM(value) AS value |
||||||
|
FROM sample_files |
||||||
|
where year = '$date' |
||||||
|
-- where sex = '$sex' |
||||||
|
GROUP BY country, year, sex, age, specimen"); |
||||||
|
} |
||||||
|
|
||||||
|
return view('pages.sample_file') |
||||||
|
->with('sample_file', $result) |
||||||
|
->with('data', $data) |
||||||
|
->with('date', $date) |
||||||
|
->with('sex', $sex); |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Controllers; |
||||||
|
|
||||||
|
use Illuminate\Http\Request; |
||||||
|
|
||||||
|
class textController extends Controller |
||||||
|
{ |
||||||
|
public function index(){ |
||||||
|
return view('pages.text'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,69 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Kernel as HttpKernel; |
||||||
|
|
||||||
|
class Kernel extends HttpKernel |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The application's global HTTP middleware stack. |
||||||
|
* |
||||||
|
* These middleware are run during every request to your application. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $middleware = [ |
||||||
|
// \App\Http\Middleware\TrustHosts::class, |
||||||
|
\App\Http\Middleware\TrustProxies::class, |
||||||
|
\Fruitcake\Cors\HandleCors::class, |
||||||
|
\App\Http\Middleware\CheckForMaintenanceMode::class, |
||||||
|
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, |
||||||
|
\App\Http\Middleware\TrimStrings::class, |
||||||
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* The application's route middleware groups. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $middlewareGroups = [ |
||||||
|
'web' => [ |
||||||
|
\App\Http\Middleware\EncryptCookies::class, |
||||||
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, |
||||||
|
\Illuminate\Session\Middleware\StartSession::class, |
||||||
|
// \Illuminate\Session\Middleware\AuthenticateSession::class, |
||||||
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class, |
||||||
|
\App\Http\Middleware\VerifyCsrfToken::class, |
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class, |
||||||
|
], |
||||||
|
|
||||||
|
'api' => [ |
||||||
|
'throttle:60,1', |
||||||
|
\Illuminate\Routing\Middleware\SubstituteBindings::class, |
||||||
|
], |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* The application's route middleware. |
||||||
|
* |
||||||
|
* These middleware may be assigned to groups or used individually. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $routeMiddleware = [ |
||||||
|
'auth' => \App\Http\Middleware\Authenticate::class, |
||||||
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, |
||||||
|
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, |
||||||
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, |
||||||
|
'can' => \Illuminate\Auth\Middleware\Authorize::class, |
||||||
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, |
||||||
|
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, |
||||||
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, |
||||||
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, |
||||||
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, |
||||||
|
'admin' => \App\Http\Middleware\AdminMiddleware::class, |
||||||
|
'pass' => \App\Http\Middleware\change_pass::class, |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Closure; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
|
||||||
|
class AdminMiddleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Handle an incoming request. |
||||||
|
* |
||||||
|
* @param \Illuminate\Http\Request $request |
||||||
|
* @param \Closure $next |
||||||
|
* @return mixed |
||||||
|
*/ |
||||||
|
public function handle($request, Closure $next) |
||||||
|
{ |
||||||
|
if (Auth::user()->role != 'Admin') { |
||||||
|
return redirect()->back(); |
||||||
|
} |
||||||
|
return $next($request); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Auth\Middleware\Authenticate as Middleware; |
||||||
|
|
||||||
|
class Authenticate extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Get the path the user should be redirected to when they are not authenticated. |
||||||
|
* |
||||||
|
* @param \Illuminate\Http\Request $request |
||||||
|
* @return string|null |
||||||
|
*/ |
||||||
|
protected function redirectTo($request) |
||||||
|
{ |
||||||
|
if (! $request->expectsJson()) { |
||||||
|
return route('login'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; |
||||||
|
|
||||||
|
class CheckForMaintenanceMode extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The URIs that should be reachable while maintenance mode is enabled. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $except = [ |
||||||
|
// |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; |
||||||
|
|
||||||
|
class EncryptCookies extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The names of the cookies that should not be encrypted. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $except = [ |
||||||
|
// |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use App\Providers\RouteServiceProvider; |
||||||
|
use Closure; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
|
||||||
|
class RedirectIfAuthenticated |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Handle an incoming request. |
||||||
|
* |
||||||
|
* @param \Illuminate\Http\Request $request |
||||||
|
* @param \Closure $next |
||||||
|
* @param string|null $guard |
||||||
|
* @return mixed |
||||||
|
*/ |
||||||
|
public function handle($request, Closure $next, $guard = null) |
||||||
|
{ |
||||||
|
if (Auth::guard($guard)->check()) { |
||||||
|
return redirect(RouteServiceProvider::HOME); |
||||||
|
} |
||||||
|
|
||||||
|
return $next($request); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,18 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; |
||||||
|
|
||||||
|
class TrimStrings extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The names of the attributes that should not be trimmed. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $except = [ |
||||||
|
'password', |
||||||
|
'password_confirmation', |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Http\Middleware\TrustHosts as Middleware; |
||||||
|
|
||||||
|
class TrustHosts extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Get the host patterns that should be trusted. |
||||||
|
* |
||||||
|
* @return array |
||||||
|
*/ |
||||||
|
public function hosts() |
||||||
|
{ |
||||||
|
return [ |
||||||
|
$this->allSubdomainsOfApplicationUrl(), |
||||||
|
]; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Fideloper\Proxy\TrustProxies as Middleware; |
||||||
|
use Illuminate\Http\Request; |
||||||
|
|
||||||
|
class TrustProxies extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The trusted proxies for this application. |
||||||
|
* |
||||||
|
* @var array|string|null |
||||||
|
*/ |
||||||
|
protected $proxies; |
||||||
|
|
||||||
|
/** |
||||||
|
* The headers that should be used to detect proxies. |
||||||
|
* |
||||||
|
* @var int |
||||||
|
*/ |
||||||
|
protected $headers = Request::HEADER_X_FORWARDED_ALL; |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; |
||||||
|
|
||||||
|
class VerifyCsrfToken extends Middleware |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The URIs that should be excluded from CSRF verification. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $except = [ |
||||||
|
// |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Http\Middleware; |
||||||
|
|
||||||
|
use Closure; |
||||||
|
use Illuminate\Support\Facades\Auth; |
||||||
|
|
||||||
|
class change_pass |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Handle an incoming request. |
||||||
|
* |
||||||
|
* @param \Illuminate\Http\Request $request |
||||||
|
* @param \Closure $next |
||||||
|
* @return mixed |
||||||
|
*/ |
||||||
|
public function handle($request, Closure $next) |
||||||
|
{ |
||||||
|
if (Auth::user()->change_pass == null) { |
||||||
|
return redirect()->route('change_pass')->with('warning', 'Please, change your password first'); |
||||||
|
} |
||||||
|
return $next($request); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Providers; |
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider; |
||||||
|
|
||||||
|
class AppServiceProvider extends ServiceProvider |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Register any application services. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function register() |
||||||
|
{ |
||||||
|
// |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Bootstrap any application services. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function boot() |
||||||
|
{ |
||||||
|
// |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Providers; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; |
||||||
|
use Illuminate\Support\Facades\Gate; |
||||||
|
|
||||||
|
class AuthServiceProvider extends ServiceProvider |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The policy mappings for the application. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $policies = [ |
||||||
|
// 'App\Model' => 'App\Policies\ModelPolicy', |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* Register any authentication / authorization services. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function boot() |
||||||
|
{ |
||||||
|
$this->registerPolicies(); |
||||||
|
|
||||||
|
// |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Providers; |
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Broadcast; |
||||||
|
use Illuminate\Support\ServiceProvider; |
||||||
|
|
||||||
|
class BroadcastServiceProvider extends ServiceProvider |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Bootstrap any application services. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function boot() |
||||||
|
{ |
||||||
|
Broadcast::routes(); |
||||||
|
|
||||||
|
require base_path('routes/channels.php'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Providers; |
||||||
|
|
||||||
|
use Illuminate\Auth\Events\Registered; |
||||||
|
use Illuminate\Auth\Listeners\SendEmailVerificationNotification; |
||||||
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; |
||||||
|
use Illuminate\Support\Facades\Event; |
||||||
|
|
||||||
|
class EventServiceProvider extends ServiceProvider |
||||||
|
{ |
||||||
|
/** |
||||||
|
* The event listener mappings for the application. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $listen = [ |
||||||
|
Registered::class => [ |
||||||
|
SendEmailVerificationNotification::class, |
||||||
|
], |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* Register any events for your application. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function boot() |
||||||
|
{ |
||||||
|
parent::boot(); |
||||||
|
|
||||||
|
// |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,80 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App\Providers; |
||||||
|
|
||||||
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |
||||||
|
use Illuminate\Support\Facades\Route; |
||||||
|
|
||||||
|
class RouteServiceProvider extends ServiceProvider |
||||||
|
{ |
||||||
|
/** |
||||||
|
* This namespace is applied to your controller routes. |
||||||
|
* |
||||||
|
* In addition, it is set as the URL generator's root namespace. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
protected $namespace = 'App\Http\Controllers'; |
||||||
|
|
||||||
|
/** |
||||||
|
* The path to the "home" route for your application. |
||||||
|
* |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
public const HOME = '/home'; |
||||||
|
|
||||||
|
/** |
||||||
|
* Define your route model bindings, pattern filters, etc. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function boot() |
||||||
|
{ |
||||||
|
// |
||||||
|
|
||||||
|
parent::boot(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Define the routes for the application. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function map() |
||||||
|
{ |
||||||
|
$this->mapApiRoutes(); |
||||||
|
|
||||||
|
$this->mapWebRoutes(); |
||||||
|
|
||||||
|
// |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Define the "web" routes for the application. |
||||||
|
* |
||||||
|
* These routes all receive session state, CSRF protection, etc. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
protected function mapWebRoutes() |
||||||
|
{ |
||||||
|
Route::middleware('web') |
||||||
|
->namespace($this->namespace) |
||||||
|
->group(base_path('routes/web.php')); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Define the "api" routes for the application. |
||||||
|
* |
||||||
|
* These routes are typically stateless. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
protected function mapApiRoutes() |
||||||
|
{ |
||||||
|
Route::prefix('api') |
||||||
|
->middleware('api') |
||||||
|
->namespace($this->namespace) |
||||||
|
->group(base_path('routes/api.php')); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App; |
||||||
|
|
||||||
|
use Illuminate\Contracts\Auth\MustVerifyEmail; |
||||||
|
use Illuminate\Foundation\Auth\User as Authenticatable; |
||||||
|
use Illuminate\Notifications\Notifiable; |
||||||
|
|
||||||
|
// class User extends Authenticatable |
||||||
|
class User extends Authenticatable implements MustVerifyEmail |
||||||
|
{ |
||||||
|
use Notifiable; |
||||||
|
// protected $table = 'users'; |
||||||
|
|
||||||
|
/** |
||||||
|
* The attributes that are mass assignable. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
// protected $fillable = [ |
||||||
|
// 'f_name', 's_name', 'l_name', 'email', 'username', 'password', |
||||||
|
// ]; |
||||||
|
|
||||||
|
/** |
||||||
|
* The attributes that should be hidden for arrays. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $hidden = [ |
||||||
|
'password', 'remember_token', |
||||||
|
]; |
||||||
|
|
||||||
|
/** |
||||||
|
* The attributes that should be cast to native types. |
||||||
|
* |
||||||
|
* @var array |
||||||
|
*/ |
||||||
|
protected $casts = [ |
||||||
|
'email_verified_at' => 'datetime', |
||||||
|
]; |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
|
||||||
|
class admin_record extends Model |
||||||
|
{ |
||||||
|
protected $table = 'users'; |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
|
||||||
|
class irsx extends Model |
||||||
|
{ |
||||||
|
// |
||||||
|
protected $table = 'ris'; |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace App; |
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model; |
||||||
|
|
||||||
|
class sample_file extends Model |
||||||
|
{ |
||||||
|
// |
||||||
|
} |
@ -0,0 +1,53 @@ |
|||||||
|
#!/usr/bin/env php |
||||||
|
<?php |
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true)); |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Register The Auto Loader |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Composer provides a convenient, automatically generated class loader |
||||||
|
| for our application. We just need to utilize it! We'll require it |
||||||
|
| into the script here so that we do not have to worry about the |
||||||
|
| loading of any our classes "manually". Feels great to relax. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
require __DIR__.'/vendor/autoload.php'; |
||||||
|
|
||||||
|
$app = require_once __DIR__.'/bootstrap/app.php'; |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Run The Artisan Application |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When we run the console application, the current CLI command will be |
||||||
|
| executed in this console and the response sent back to a terminal |
||||||
|
| or another output device for the developers. Here goes nothing! |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); |
||||||
|
|
||||||
|
$status = $kernel->handle( |
||||||
|
$input = new Symfony\Component\Console\Input\ArgvInput, |
||||||
|
new Symfony\Component\Console\Output\ConsoleOutput |
||||||
|
); |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Shutdown The Application |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Once Artisan has finished running, we will fire off the shutdown events |
||||||
|
| so that any final work may be done by the application before we shut |
||||||
|
| down the process. This is the last thing to happen to the request. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$kernel->terminate($input, $status); |
||||||
|
|
||||||
|
exit($status); |
@ -0,0 +1,55 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Create The Application |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| The first thing we will do is create a new Laravel application instance |
||||||
|
| which serves as the "glue" for all the components of Laravel, and is |
||||||
|
| the IoC container for the system binding all of the various parts. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$app = new Illuminate\Foundation\Application( |
||||||
|
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__) |
||||||
|
); |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Bind Important Interfaces |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Next, we need to bind some important interfaces into the container so |
||||||
|
| we will be able to resolve them when needed. The kernels serve the |
||||||
|
| incoming requests to this application from both the web and CLI. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$app->singleton( |
||||||
|
Illuminate\Contracts\Http\Kernel::class, |
||||||
|
App\Http\Kernel::class |
||||||
|
); |
||||||
|
|
||||||
|
$app->singleton( |
||||||
|
Illuminate\Contracts\Console\Kernel::class, |
||||||
|
App\Console\Kernel::class |
||||||
|
); |
||||||
|
|
||||||
|
$app->singleton( |
||||||
|
Illuminate\Contracts\Debug\ExceptionHandler::class, |
||||||
|
App\Exceptions\Handler::class |
||||||
|
); |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Return The Application |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This script returns the application instance. The instance is given to |
||||||
|
| the calling script so we can separate the building of the instances |
||||||
|
| from the actual running of the application and sending responses. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
return $app; |
@ -0,0 +1,2 @@ |
|||||||
|
* |
||||||
|
!.gitignore |
@ -0,0 +1,66 @@ |
|||||||
|
{ |
||||||
|
"name": "laravel/laravel", |
||||||
|
"type": "project", |
||||||
|
"description": "The Laravel Framework.", |
||||||
|
"keywords": [ |
||||||
|
"framework", |
||||||
|
"laravel" |
||||||
|
], |
||||||
|
"license": "MIT", |
||||||
|
"require": { |
||||||
|
"php": "^7.2.5", |
||||||
|
"doctrine/dbal": "^2.10", |
||||||
|
"fideloper/proxy": "^4.2", |
||||||
|
"fruitcake/laravel-cors": "^1.0", |
||||||
|
"guzzlehttp/guzzle": "^6.3", |
||||||
|
"laravel/framework": "^7.0", |
||||||
|
"laravel/tinker": "^2.0", |
||||||
|
"laravel/ui": "^2.0", |
||||||
|
"pearl/csv-json-converter": "^1.0" |
||||||
|
}, |
||||||
|
"require-dev": { |
||||||
|
"facade/ignition": "^2.0", |
||||||
|
"fzaninotto/faker": "^1.9.1", |
||||||
|
"mockery/mockery": "^1.3.1", |
||||||
|
"nunomaduro/collision": "^4.1", |
||||||
|
"phpunit/phpunit": "^8.5" |
||||||
|
}, |
||||||
|
"config": { |
||||||
|
"optimize-autoloader": true, |
||||||
|
"preferred-install": "dist", |
||||||
|
"sort-packages": true |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"laravel": { |
||||||
|
"dont-discover": [] |
||||||
|
} |
||||||
|
}, |
||||||
|
"autoload": { |
||||||
|
"psr-4": { |
||||||
|
"App\\": "app/" |
||||||
|
}, |
||||||
|
"classmap": [ |
||||||
|
"database/seeds", |
||||||
|
"database/factories" |
||||||
|
] |
||||||
|
}, |
||||||
|
"autoload-dev": { |
||||||
|
"psr-4": { |
||||||
|
"Tests\\": "tests/" |
||||||
|
} |
||||||
|
}, |
||||||
|
"minimum-stability": "dev", |
||||||
|
"prefer-stable": true, |
||||||
|
"scripts": { |
||||||
|
"post-autoload-dump": [ |
||||||
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", |
||||||
|
"@php artisan package:discover --ansi" |
||||||
|
], |
||||||
|
"post-root-package-install": [ |
||||||
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" |
||||||
|
], |
||||||
|
"post-create-project-cmd": [ |
||||||
|
"@php artisan key:generate --ansi" |
||||||
|
] |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,232 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Name |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This value is the name of your application. This value is used when the |
||||||
|
| framework needs to place the application's name in a notification or |
||||||
|
| any other location as required by the application or its packages. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'name' => env('APP_NAME', 'Laravel'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Environment |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This value determines the "environment" your application is currently |
||||||
|
| running in. This may determine how you prefer to configure various |
||||||
|
| services the application utilizes. Set this in your ".env" file. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'env' => env('APP_ENV', 'production'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Debug Mode |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When your application is in debug mode, detailed error messages with |
||||||
|
| stack traces will be shown on every error that occurs within your |
||||||
|
| application. If disabled, a simple generic error page is shown. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'debug' => (bool) env('APP_DEBUG', false), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application URL |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This URL is used by the console to properly generate URLs when using |
||||||
|
| the Artisan command line tool. You should set this to the root of |
||||||
|
| your application so that it is used when running Artisan tasks. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'url' => env('APP_URL', 'http://localhost'), |
||||||
|
|
||||||
|
'asset_url' => env('ASSET_URL', null), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Timezone |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify the default timezone for your application, which |
||||||
|
| will be used by the PHP date and date-time functions. We have gone |
||||||
|
| ahead and set this to a sensible default for you out of the box. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'timezone' => 'UTC', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Locale Configuration |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| The application locale determines the default locale that will be used |
||||||
|
| by the translation service provider. You are free to set this value |
||||||
|
| to any of the locales which will be supported by the application. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'locale' => 'en', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Application Fallback Locale |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| The fallback locale determines the locale to use when the current one |
||||||
|
| is not available. You may change the value to correspond to any of |
||||||
|
| the language folders that are provided through your application. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'fallback_locale' => 'en', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Faker Locale |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This locale will be used by the Faker PHP library when generating fake |
||||||
|
| data for your database seeds. For example, this will be used to get |
||||||
|
| localized telephone numbers, street address information and more. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'faker_locale' => 'en_US', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Encryption Key |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This key is used by the Illuminate encrypter service and should be set |
||||||
|
| to a random, 32 character string, otherwise these encrypted strings |
||||||
|
| will not be safe. Please do this before deploying an application! |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'key' => env('APP_KEY'), |
||||||
|
|
||||||
|
'cipher' => 'AES-256-CBC', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Autoloaded Service Providers |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| The service providers listed here will be automatically loaded on the |
||||||
|
| request to your application. Feel free to add your own services to |
||||||
|
| this array to grant expanded functionality to your applications. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'providers' => [ |
||||||
|
|
||||||
|
/* |
||||||
|
* Laravel Framework Service Providers... |
||||||
|
*/ |
||||||
|
Illuminate\Auth\AuthServiceProvider::class, |
||||||
|
Illuminate\Broadcasting\BroadcastServiceProvider::class, |
||||||
|
Illuminate\Bus\BusServiceProvider::class, |
||||||
|
Illuminate\Cache\CacheServiceProvider::class, |
||||||
|
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, |
||||||
|
Illuminate\Cookie\CookieServiceProvider::class, |
||||||
|
Illuminate\Database\DatabaseServiceProvider::class, |
||||||
|
Illuminate\Encryption\EncryptionServiceProvider::class, |
||||||
|
Illuminate\Filesystem\FilesystemServiceProvider::class, |
||||||
|
Illuminate\Foundation\Providers\FoundationServiceProvider::class, |
||||||
|
Illuminate\Hashing\HashServiceProvider::class, |
||||||
|
Illuminate\Mail\MailServiceProvider::class, |
||||||
|
Illuminate\Notifications\NotificationServiceProvider::class, |
||||||
|
Illuminate\Pagination\PaginationServiceProvider::class, |
||||||
|
Illuminate\Pipeline\PipelineServiceProvider::class, |
||||||
|
Illuminate\Queue\QueueServiceProvider::class, |
||||||
|
Illuminate\Redis\RedisServiceProvider::class, |
||||||
|
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, |
||||||
|
Illuminate\Session\SessionServiceProvider::class, |
||||||
|
Illuminate\Translation\TranslationServiceProvider::class, |
||||||
|
Illuminate\Validation\ValidationServiceProvider::class, |
||||||
|
Illuminate\View\ViewServiceProvider::class, |
||||||
|
|
||||||
|
/* |
||||||
|
* Package Service Providers... |
||||||
|
*/ |
||||||
|
|
||||||
|
/* |
||||||
|
* Application Service Providers... |
||||||
|
*/ |
||||||
|
App\Providers\AppServiceProvider::class, |
||||||
|
App\Providers\AuthServiceProvider::class, |
||||||
|
// App\Providers\BroadcastServiceProvider::class, |
||||||
|
App\Providers\EventServiceProvider::class, |
||||||
|
App\Providers\RouteServiceProvider::class, |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Class Aliases |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This array of class aliases will be registered when this application |
||||||
|
| is started. However, feel free to register as many as you wish as |
||||||
|
| the aliases are "lazy" loaded so they don't hinder performance. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'aliases' => [ |
||||||
|
|
||||||
|
'App' => Illuminate\Support\Facades\App::class, |
||||||
|
'Arr' => Illuminate\Support\Arr::class, |
||||||
|
'Artisan' => Illuminate\Support\Facades\Artisan::class, |
||||||
|
'Auth' => Illuminate\Support\Facades\Auth::class, |
||||||
|
'Blade' => Illuminate\Support\Facades\Blade::class, |
||||||
|
'Broadcast' => Illuminate\Support\Facades\Broadcast::class, |
||||||
|
'Bus' => Illuminate\Support\Facades\Bus::class, |
||||||
|
'Cache' => Illuminate\Support\Facades\Cache::class, |
||||||
|
'Config' => Illuminate\Support\Facades\Config::class, |
||||||
|
'Cookie' => Illuminate\Support\Facades\Cookie::class, |
||||||
|
'Crypt' => Illuminate\Support\Facades\Crypt::class, |
||||||
|
'DB' => Illuminate\Support\Facades\DB::class, |
||||||
|
'Eloquent' => Illuminate\Database\Eloquent\Model::class, |
||||||
|
'Event' => Illuminate\Support\Facades\Event::class, |
||||||
|
'File' => Illuminate\Support\Facades\File::class, |
||||||
|
'Gate' => Illuminate\Support\Facades\Gate::class, |
||||||
|
'Hash' => Illuminate\Support\Facades\Hash::class, |
||||||
|
'Http' => Illuminate\Support\Facades\Http::class, |
||||||
|
'Lang' => Illuminate\Support\Facades\Lang::class, |
||||||
|
'Log' => Illuminate\Support\Facades\Log::class, |
||||||
|
'Mail' => Illuminate\Support\Facades\Mail::class, |
||||||
|
'Notification' => Illuminate\Support\Facades\Notification::class, |
||||||
|
'Password' => Illuminate\Support\Facades\Password::class, |
||||||
|
'Queue' => Illuminate\Support\Facades\Queue::class, |
||||||
|
'Redirect' => Illuminate\Support\Facades\Redirect::class, |
||||||
|
'Redis' => Illuminate\Support\Facades\Redis::class, |
||||||
|
'Request' => Illuminate\Support\Facades\Request::class, |
||||||
|
'Response' => Illuminate\Support\Facades\Response::class, |
||||||
|
'Route' => Illuminate\Support\Facades\Route::class, |
||||||
|
'Schema' => Illuminate\Support\Facades\Schema::class, |
||||||
|
'Session' => Illuminate\Support\Facades\Session::class, |
||||||
|
'Storage' => Illuminate\Support\Facades\Storage::class, |
||||||
|
'Str' => Illuminate\Support\Str::class, |
||||||
|
'URL' => Illuminate\Support\Facades\URL::class, |
||||||
|
'Validator' => Illuminate\Support\Facades\Validator::class, |
||||||
|
'View' => Illuminate\Support\Facades\View::class, |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,117 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Authentication Defaults |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default authentication "guard" and password |
||||||
|
| reset options for your application. You may change these defaults |
||||||
|
| as required, but they're a perfect start for most applications. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'defaults' => [ |
||||||
|
'guard' => 'web', |
||||||
|
'passwords' => 'users', |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Authentication Guards |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Next, you may define every authentication guard for your application. |
||||||
|
| Of course, a great default configuration has been defined for you |
||||||
|
| here which uses session storage and the Eloquent user provider. |
||||||
|
| |
||||||
|
| All authentication drivers have a user provider. This defines how the |
||||||
|
| users are actually retrieved out of your database or other storage |
||||||
|
| mechanisms used by this application to persist your user's data. |
||||||
|
| |
||||||
|
| Supported: "session", "token" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'guards' => [ |
||||||
|
'web' => [ |
||||||
|
'driver' => 'session', |
||||||
|
'provider' => 'users', |
||||||
|
], |
||||||
|
|
||||||
|
'api' => [ |
||||||
|
'driver' => 'token', |
||||||
|
'provider' => 'users', |
||||||
|
'hash' => false, |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| User Providers |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| All authentication drivers have a user provider. This defines how the |
||||||
|
| users are actually retrieved out of your database or other storage |
||||||
|
| mechanisms used by this application to persist your user's data. |
||||||
|
| |
||||||
|
| If you have multiple user tables or models you may configure multiple |
||||||
|
| sources which represent each model / table. These sources may then |
||||||
|
| be assigned to any extra authentication guards you have defined. |
||||||
|
| |
||||||
|
| Supported: "database", "eloquent" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'providers' => [ |
||||||
|
'users' => [ |
||||||
|
'driver' => 'eloquent', |
||||||
|
'model' => App\User::class, |
||||||
|
], |
||||||
|
|
||||||
|
// 'users' => [ |
||||||
|
// 'driver' => 'database', |
||||||
|
// 'table' => 'users', |
||||||
|
// ], |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Resetting Passwords |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| You may specify multiple password reset configurations if you have more |
||||||
|
| than one user table or model in the application and you want to have |
||||||
|
| separate password reset settings based on the specific user types. |
||||||
|
| |
||||||
|
| The expire time is the number of minutes that the reset token should be |
||||||
|
| considered valid. This security feature keeps tokens short-lived so |
||||||
|
| they have less time to be guessed. You may change this as needed. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'passwords' => [ |
||||||
|
'users' => [ |
||||||
|
'provider' => 'users', |
||||||
|
'table' => 'password_resets', |
||||||
|
'expire' => 60, |
||||||
|
'throttle' => 60, |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Password Confirmation Timeout |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may define the amount of seconds before a password confirmation |
||||||
|
| times out and the user is prompted to re-enter their password via the |
||||||
|
| confirmation screen. By default, the timeout lasts for three hours. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'password_timeout' => 10800, |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,59 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Broadcaster |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default broadcaster that will be used by the |
||||||
|
| framework when an event needs to be broadcast. You may set this to |
||||||
|
| any of the connections defined in the "connections" array below. |
||||||
|
| |
||||||
|
| Supported: "pusher", "redis", "log", "null" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('BROADCAST_DRIVER', 'null'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Broadcast Connections |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may define all of the broadcast connections that will be used |
||||||
|
| to broadcast events to other systems or over websockets. Samples of |
||||||
|
| each available type of connection are provided inside this array. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'connections' => [ |
||||||
|
|
||||||
|
'pusher' => [ |
||||||
|
'driver' => 'pusher', |
||||||
|
'key' => env('PUSHER_APP_KEY'), |
||||||
|
'secret' => env('PUSHER_APP_SECRET'), |
||||||
|
'app_id' => env('PUSHER_APP_ID'), |
||||||
|
'options' => [ |
||||||
|
'cluster' => env('PUSHER_APP_CLUSTER'), |
||||||
|
'useTLS' => true, |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
'redis' => [ |
||||||
|
'driver' => 'redis', |
||||||
|
'connection' => 'default', |
||||||
|
], |
||||||
|
|
||||||
|
'log' => [ |
||||||
|
'driver' => 'log', |
||||||
|
], |
||||||
|
|
||||||
|
'null' => [ |
||||||
|
'driver' => 'null', |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,104 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Support\Str; |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Cache Store |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default cache connection that gets used while |
||||||
|
| using this caching library. This connection is used when another is |
||||||
|
| not explicitly specified when executing a given caching function. |
||||||
|
| |
||||||
|
| Supported: "apc", "array", "database", "file", |
||||||
|
| "memcached", "redis", "dynamodb" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('CACHE_DRIVER', 'file'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Cache Stores |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may define all of the cache "stores" for your application as |
||||||
|
| well as their drivers. You may even define multiple stores for the |
||||||
|
| same cache driver to group types of items stored in your caches. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'stores' => [ |
||||||
|
|
||||||
|
'apc' => [ |
||||||
|
'driver' => 'apc', |
||||||
|
], |
||||||
|
|
||||||
|
'array' => [ |
||||||
|
'driver' => 'array', |
||||||
|
'serialize' => false, |
||||||
|
], |
||||||
|
|
||||||
|
'database' => [ |
||||||
|
'driver' => 'database', |
||||||
|
'table' => 'cache', |
||||||
|
'connection' => null, |
||||||
|
], |
||||||
|
|
||||||
|
'file' => [ |
||||||
|
'driver' => 'file', |
||||||
|
'path' => storage_path('framework/cache/data'), |
||||||
|
], |
||||||
|
|
||||||
|
'memcached' => [ |
||||||
|
'driver' => 'memcached', |
||||||
|
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), |
||||||
|
'sasl' => [ |
||||||
|
env('MEMCACHED_USERNAME'), |
||||||
|
env('MEMCACHED_PASSWORD'), |
||||||
|
], |
||||||
|
'options' => [ |
||||||
|
// Memcached::OPT_CONNECT_TIMEOUT => 2000, |
||||||
|
], |
||||||
|
'servers' => [ |
||||||
|
[ |
||||||
|
'host' => env('MEMCACHED_HOST', '127.0.0.1'), |
||||||
|
'port' => env('MEMCACHED_PORT', 11211), |
||||||
|
'weight' => 100, |
||||||
|
], |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
'redis' => [ |
||||||
|
'driver' => 'redis', |
||||||
|
'connection' => 'cache', |
||||||
|
], |
||||||
|
|
||||||
|
'dynamodb' => [ |
||||||
|
'driver' => 'dynamodb', |
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'), |
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'), |
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), |
||||||
|
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), |
||||||
|
'endpoint' => env('DYNAMODB_ENDPOINT'), |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Cache Key Prefix |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When utilizing a RAM based store such as APC or Memcached, there might |
||||||
|
| be other applications utilizing the same cache. So, we'll specify a |
||||||
|
| value to get prefixed to all our keys so we can avoid collisions. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,34 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Cross-Origin Resource Sharing (CORS) Configuration |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure your settings for cross-origin resource sharing |
||||||
|
| or "CORS". This determines what cross-origin operations may execute |
||||||
|
| in web browsers. You are free to adjust these settings as needed. |
||||||
|
| |
||||||
|
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'paths' => ['api/*'], |
||||||
|
|
||||||
|
'allowed_methods' => ['*'], |
||||||
|
|
||||||
|
'allowed_origins' => ['*'], |
||||||
|
|
||||||
|
'allowed_origins_patterns' => [], |
||||||
|
|
||||||
|
'allowed_headers' => ['*'], |
||||||
|
|
||||||
|
'exposed_headers' => [], |
||||||
|
|
||||||
|
'max_age' => 0, |
||||||
|
|
||||||
|
'supports_credentials' => false, |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,147 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Support\Str; |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Database Connection Name |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify which of the database connections below you wish |
||||||
|
| to use as your default connection for all database work. Of course |
||||||
|
| you may use many connections at once using the Database library. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('DB_CONNECTION', 'pgsql'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Database Connections |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here are each of the database connections setup for your application. |
||||||
|
| Of course, examples of configuring each database platform that is |
||||||
|
| supported by Laravel is shown below to make development simple. |
||||||
|
| |
||||||
|
| |
||||||
|
| All database work in Laravel is done through the PHP PDO facilities |
||||||
|
| so make sure you have the driver for your particular database of |
||||||
|
| choice installed on your machine before you begin development. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'connections' => [ |
||||||
|
|
||||||
|
'sqlite' => [ |
||||||
|
'driver' => 'sqlite', |
||||||
|
'url' => env('DATABASE_URL'), |
||||||
|
'database' => env('DB_DATABASE', database_path('database.sqlite')), |
||||||
|
'prefix' => '', |
||||||
|
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), |
||||||
|
], |
||||||
|
|
||||||
|
'mysql' => [ |
||||||
|
'driver' => 'mysql', |
||||||
|
'url' => env('DATABASE_URL'), |
||||||
|
'host' => env('DB_HOST', '127.0.0.1'), |
||||||
|
'port' => env('DB_PORT', '3306'), |
||||||
|
'database' => env('DB_DATABASE', 'forge'), |
||||||
|
'username' => env('DB_USERNAME', 'forge'), |
||||||
|
'password' => env('DB_PASSWORD', ''), |
||||||
|
'unix_socket' => env('DB_SOCKET', ''), |
||||||
|
'charset' => 'utf8mb4', |
||||||
|
'collation' => 'utf8mb4_unicode_ci', |
||||||
|
'prefix' => '', |
||||||
|
'prefix_indexes' => true, |
||||||
|
'strict' => false, |
||||||
|
'engine' => null, |
||||||
|
'options' => extension_loaded('pdo_mysql') ? array_filter([ |
||||||
|
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), |
||||||
|
]) : [], |
||||||
|
], |
||||||
|
|
||||||
|
'pgsql' => [ |
||||||
|
'driver' => 'pgsql', |
||||||
|
'url' => env('DATABASE_URL'), |
||||||
|
'host' => env('DB_HOST', '127.0.0.1'), |
||||||
|
'port' => env('DB_PORT', '5432'), |
||||||
|
'database' => env('DB_DATABASE', 'forge'), |
||||||
|
'username' => env('DB_USERNAME', 'forge'), |
||||||
|
'password' => env('DB_PASSWORD', ''), |
||||||
|
'charset' => 'utf8', |
||||||
|
'prefix' => '', |
||||||
|
'prefix_indexes' => true, |
||||||
|
'schema' => 'public', |
||||||
|
'sslmode' => 'prefer', |
||||||
|
], |
||||||
|
|
||||||
|
'sqlsrv' => [ |
||||||
|
'driver' => 'sqlsrv', |
||||||
|
'url' => env('DATABASE_URL'), |
||||||
|
'host' => env('DB_HOST', 'localhost'), |
||||||
|
'port' => env('DB_PORT', '1433'), |
||||||
|
'database' => env('DB_DATABASE', 'forge'), |
||||||
|
'username' => env('DB_USERNAME', 'forge'), |
||||||
|
'password' => env('DB_PASSWORD', ''), |
||||||
|
'charset' => 'utf8', |
||||||
|
'prefix' => '', |
||||||
|
'prefix_indexes' => true, |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Migration Repository Table |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This table keeps track of all the migrations that have already run for |
||||||
|
| your application. Using this information, we can determine which of |
||||||
|
| the migrations on disk haven't actually been run in the database. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'migrations' => 'migrations', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Redis Databases |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Redis is an open source, fast, and advanced key-value store that also |
||||||
|
| provides a richer body of commands than a typical key-value system |
||||||
|
| such as APC or Memcached. Laravel makes it easy to dig right in. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'redis' => [ |
||||||
|
|
||||||
|
'client' => env('REDIS_CLIENT', 'phpredis'), |
||||||
|
|
||||||
|
'options' => [ |
||||||
|
'cluster' => env('REDIS_CLUSTER', 'redis'), |
||||||
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), |
||||||
|
], |
||||||
|
|
||||||
|
'default' => [ |
||||||
|
'url' => env('REDIS_URL'), |
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'), |
||||||
|
'password' => env('REDIS_PASSWORD', null), |
||||||
|
'port' => env('REDIS_PORT', '6379'), |
||||||
|
'database' => env('REDIS_DB', '0'), |
||||||
|
], |
||||||
|
|
||||||
|
'cache' => [ |
||||||
|
'url' => env('REDIS_URL'), |
||||||
|
'host' => env('REDIS_HOST', '127.0.0.1'), |
||||||
|
'password' => env('REDIS_PASSWORD', null), |
||||||
|
'port' => env('REDIS_PORT', '6379'), |
||||||
|
'database' => env('REDIS_CACHE_DB', '1'), |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,85 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Filesystem Disk |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify the default filesystem disk that should be used |
||||||
|
| by the framework. The "local" disk, as well as a variety of cloud |
||||||
|
| based disks are available to your application. Just store away! |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('FILESYSTEM_DRIVER', 'local'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Cloud Filesystem Disk |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Many applications store files both locally and in the cloud. For this |
||||||
|
| reason, you may specify a default "cloud" driver here. This driver |
||||||
|
| will be bound as the Cloud disk implementation in the container. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'cloud' => env('FILESYSTEM_CLOUD', 's3'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Filesystem Disks |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure as many filesystem "disks" as you wish, and you |
||||||
|
| may even configure multiple disks of the same driver. Defaults have |
||||||
|
| been setup for each driver as an example of the required options. |
||||||
|
| |
||||||
|
| Supported Drivers: "local", "ftp", "sftp", "s3" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'disks' => [ |
||||||
|
|
||||||
|
'local' => [ |
||||||
|
'driver' => 'local', |
||||||
|
'root' => storage_path('app'), |
||||||
|
], |
||||||
|
|
||||||
|
'public' => [ |
||||||
|
'driver' => 'local', |
||||||
|
'root' => storage_path('app/public'), |
||||||
|
'url' => env('APP_URL').'/storage', |
||||||
|
'visibility' => 'public', |
||||||
|
], |
||||||
|
|
||||||
|
's3' => [ |
||||||
|
'driver' => 's3', |
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'), |
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'), |
||||||
|
'region' => env('AWS_DEFAULT_REGION'), |
||||||
|
'bucket' => env('AWS_BUCKET'), |
||||||
|
'url' => env('AWS_URL'), |
||||||
|
'endpoint' => env('AWS_ENDPOINT'), |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Symbolic Links |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure the symbolic links that will be created when the |
||||||
|
| `storage:link` Artisan command is executed. The array keys should be |
||||||
|
| the locations of the links and the values should be their targets. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'links' => [ |
||||||
|
public_path('storage') => storage_path('app/public'), |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,52 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Hash Driver |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default hash driver that will be used to hash |
||||||
|
| passwords for your application. By default, the bcrypt algorithm is |
||||||
|
| used; however, you remain free to modify this option if you wish. |
||||||
|
| |
||||||
|
| Supported: "bcrypt", "argon", "argon2id" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'driver' => 'bcrypt', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Bcrypt Options |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify the configuration options that should be used when |
||||||
|
| passwords are hashed using the Bcrypt algorithm. This will allow you |
||||||
|
| to control the amount of time it takes to hash the given password. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'bcrypt' => [ |
||||||
|
'rounds' => env('BCRYPT_ROUNDS', 10), |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Argon Options |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify the configuration options that should be used when |
||||||
|
| passwords are hashed using the Argon algorithm. These will allow you |
||||||
|
| to control the amount of time it takes to hash the given password. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'argon' => [ |
||||||
|
'memory' => 1024, |
||||||
|
'threads' => 2, |
||||||
|
'time' => 2, |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,104 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Monolog\Handler\NullHandler; |
||||||
|
use Monolog\Handler\StreamHandler; |
||||||
|
use Monolog\Handler\SyslogUdpHandler; |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Log Channel |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option defines the default log channel that gets used when writing |
||||||
|
| messages to the logs. The name specified in this option should match |
||||||
|
| one of the channels defined in the "channels" configuration array. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('LOG_CHANNEL', 'stack'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Log Channels |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure the log channels for your application. Out of |
||||||
|
| the box, Laravel uses the Monolog PHP logging library. This gives |
||||||
|
| you a variety of powerful log handlers / formatters to utilize. |
||||||
|
| |
||||||
|
| Available Drivers: "single", "daily", "slack", "syslog", |
||||||
|
| "errorlog", "monolog", |
||||||
|
| "custom", "stack" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'channels' => [ |
||||||
|
'stack' => [ |
||||||
|
'driver' => 'stack', |
||||||
|
'channels' => ['single'], |
||||||
|
'ignore_exceptions' => false, |
||||||
|
], |
||||||
|
|
||||||
|
'single' => [ |
||||||
|
'driver' => 'single', |
||||||
|
'path' => storage_path('logs/laravel.log'), |
||||||
|
'level' => 'debug', |
||||||
|
], |
||||||
|
|
||||||
|
'daily' => [ |
||||||
|
'driver' => 'daily', |
||||||
|
'path' => storage_path('logs/laravel.log'), |
||||||
|
'level' => 'debug', |
||||||
|
'days' => 14, |
||||||
|
], |
||||||
|
|
||||||
|
'slack' => [ |
||||||
|
'driver' => 'slack', |
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'), |
||||||
|
'username' => 'Laravel Log', |
||||||
|
'emoji' => ':boom:', |
||||||
|
'level' => 'critical', |
||||||
|
], |
||||||
|
|
||||||
|
'papertrail' => [ |
||||||
|
'driver' => 'monolog', |
||||||
|
'level' => 'debug', |
||||||
|
'handler' => SyslogUdpHandler::class, |
||||||
|
'handler_with' => [ |
||||||
|
'host' => env('PAPERTRAIL_URL'), |
||||||
|
'port' => env('PAPERTRAIL_PORT'), |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
'stderr' => [ |
||||||
|
'driver' => 'monolog', |
||||||
|
'handler' => StreamHandler::class, |
||||||
|
'formatter' => env('LOG_STDERR_FORMATTER'), |
||||||
|
'with' => [ |
||||||
|
'stream' => 'php://stderr', |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
'syslog' => [ |
||||||
|
'driver' => 'syslog', |
||||||
|
'level' => 'debug', |
||||||
|
], |
||||||
|
|
||||||
|
'errorlog' => [ |
||||||
|
'driver' => 'errorlog', |
||||||
|
'level' => 'debug', |
||||||
|
], |
||||||
|
|
||||||
|
'null' => [ |
||||||
|
'driver' => 'monolog', |
||||||
|
'handler' => NullHandler::class, |
||||||
|
], |
||||||
|
|
||||||
|
'emergency' => [ |
||||||
|
'path' => storage_path('logs/laravel.log'), |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,110 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Mailer |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default mailer that is used to send any email |
||||||
|
| messages sent by your application. Alternative mailers may be setup |
||||||
|
| and used as needed; however, this mailer will be used by default. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('MAIL_MAILER', 'smtp'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Mailer Configurations |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure all of the mailers used by your application plus |
||||||
|
| their respective settings. Several examples have been configured for |
||||||
|
| you and you are free to add your own as your application requires. |
||||||
|
| |
||||||
|
| Laravel supports a variety of mail "transport" drivers to be used while |
||||||
|
| sending an e-mail. You will specify which one you are using for your |
||||||
|
| mailers below. You are free to add additional mailers as required. |
||||||
|
| |
||||||
|
| Supported: "smtp", "sendmail", "mailgun", "ses", |
||||||
|
| "postmark", "log", "array" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'mailers' => [ |
||||||
|
'smtp' => [ |
||||||
|
'transport' => 'smtp', |
||||||
|
'host' => env('MAIL_HOST', 'smtp.mailgun.org'), |
||||||
|
'port' => env('MAIL_PORT', 587), |
||||||
|
'encryption' => env('MAIL_ENCRYPTION', 'tls'), |
||||||
|
'username' => env('MAIL_USERNAME'), |
||||||
|
'password' => env('MAIL_PASSWORD'), |
||||||
|
'timeout' => null, |
||||||
|
'auth_mode' => null, |
||||||
|
], |
||||||
|
|
||||||
|
'ses' => [ |
||||||
|
'transport' => 'ses', |
||||||
|
], |
||||||
|
|
||||||
|
'mailgun' => [ |
||||||
|
'transport' => 'mailgun', |
||||||
|
], |
||||||
|
|
||||||
|
'postmark' => [ |
||||||
|
'transport' => 'postmark', |
||||||
|
], |
||||||
|
|
||||||
|
'sendmail' => [ |
||||||
|
'transport' => 'sendmail', |
||||||
|
'path' => '/usr/sbin/sendmail -bs', |
||||||
|
], |
||||||
|
|
||||||
|
'log' => [ |
||||||
|
'transport' => 'log', |
||||||
|
'channel' => env('MAIL_LOG_CHANNEL'), |
||||||
|
], |
||||||
|
|
||||||
|
'array' => [ |
||||||
|
'transport' => 'array', |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Global "From" Address |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| You may wish for all e-mails sent by your application to be sent from |
||||||
|
| the same address. Here, you may specify a name and address that is |
||||||
|
| used globally for all e-mails that are sent by your application. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'from' => [ |
||||||
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), |
||||||
|
'name' => env('MAIL_FROM_NAME', 'Example'), |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Markdown Mail Settings |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| If you are using Markdown based email rendering, you may configure your |
||||||
|
| theme and component paths here, allowing you to customize the design |
||||||
|
| of the emails. Or, you may simply stick with the Laravel defaults! |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'markdown' => [ |
||||||
|
'theme' => 'default', |
||||||
|
|
||||||
|
'paths' => [ |
||||||
|
resource_path('views/vendor/mail'), |
||||||
|
], |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,89 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Queue Connection Name |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Laravel's queue API supports an assortment of back-ends via a single |
||||||
|
| API, giving you convenient access to each back-end using the same |
||||||
|
| syntax for every one. Here you may define a default connection. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'default' => env('QUEUE_CONNECTION', 'sync'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Queue Connections |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may configure the connection information for each server that |
||||||
|
| is used by your application. A default configuration has been added |
||||||
|
| for each back-end shipped with Laravel. You are free to add more. |
||||||
|
| |
||||||
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'connections' => [ |
||||||
|
|
||||||
|
'sync' => [ |
||||||
|
'driver' => 'sync', |
||||||
|
], |
||||||
|
|
||||||
|
'database' => [ |
||||||
|
'driver' => 'database', |
||||||
|
'table' => 'jobs', |
||||||
|
'queue' => 'default', |
||||||
|
'retry_after' => 90, |
||||||
|
], |
||||||
|
|
||||||
|
'beanstalkd' => [ |
||||||
|
'driver' => 'beanstalkd', |
||||||
|
'host' => 'localhost', |
||||||
|
'queue' => 'default', |
||||||
|
'retry_after' => 90, |
||||||
|
'block_for' => 0, |
||||||
|
], |
||||||
|
|
||||||
|
'sqs' => [ |
||||||
|
'driver' => 'sqs', |
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'), |
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'), |
||||||
|
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), |
||||||
|
'queue' => env('SQS_QUEUE', 'your-queue-name'), |
||||||
|
'suffix' => env('SQS_SUFFIX'), |
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), |
||||||
|
], |
||||||
|
|
||||||
|
'redis' => [ |
||||||
|
'driver' => 'redis', |
||||||
|
'connection' => 'default', |
||||||
|
'queue' => env('REDIS_QUEUE', 'default'), |
||||||
|
'retry_after' => 90, |
||||||
|
'block_for' => null, |
||||||
|
], |
||||||
|
|
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Failed Queue Jobs |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| These options configure the behavior of failed queue job logging so you |
||||||
|
| can control which database and table are used to store the jobs that |
||||||
|
| have failed. You may change them to any database / table you wish. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'failed' => [ |
||||||
|
'driver' => env('QUEUE_FAILED_DRIVER', 'database'), |
||||||
|
'database' => env('DB_CONNECTION', 'mysql'), |
||||||
|
'table' => 'failed_jobs', |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,33 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Third Party Services |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This file is for storing the credentials for third party services such |
||||||
|
| as Mailgun, Postmark, AWS and more. This file provides the de facto |
||||||
|
| location for this type of information, allowing packages to have |
||||||
|
| a conventional file to locate the various service credentials. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'mailgun' => [ |
||||||
|
'domain' => env('MAILGUN_DOMAIN'), |
||||||
|
'secret' => env('MAILGUN_SECRET'), |
||||||
|
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), |
||||||
|
], |
||||||
|
|
||||||
|
'postmark' => [ |
||||||
|
'token' => env('POSTMARK_TOKEN'), |
||||||
|
], |
||||||
|
|
||||||
|
'ses' => [ |
||||||
|
'key' => env('AWS_ACCESS_KEY_ID'), |
||||||
|
'secret' => env('AWS_SECRET_ACCESS_KEY'), |
||||||
|
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), |
||||||
|
], |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,201 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Support\Str; |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Default Session Driver |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option controls the default session "driver" that will be used on |
||||||
|
| requests. By default, we will use the lightweight native driver but |
||||||
|
| you may specify any of the other wonderful drivers provided here. |
||||||
|
| |
||||||
|
| Supported: "file", "cookie", "database", "apc", |
||||||
|
| "memcached", "redis", "dynamodb", "array" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'driver' => env('SESSION_DRIVER', 'file'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Lifetime |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may specify the number of minutes that you wish the session |
||||||
|
| to be allowed to remain idle before it expires. If you want them |
||||||
|
| to immediately expire on the browser closing, set that option. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'lifetime' => env('SESSION_LIFETIME', 120), |
||||||
|
|
||||||
|
'expire_on_close' => false, |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Encryption |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option allows you to easily specify that all of your session data |
||||||
|
| should be encrypted before it is stored. All encryption will be run |
||||||
|
| automatically by Laravel and you can use the Session like normal. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'encrypt' => false, |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session File Location |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When using the native session driver, we need a location where session |
||||||
|
| files may be stored. A default has been set for you but a different |
||||||
|
| location may be specified. This is only needed for file sessions. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'files' => storage_path('framework/sessions'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Database Connection |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When using the "database" or "redis" session drivers, you may specify a |
||||||
|
| connection that should be used to manage these sessions. This should |
||||||
|
| correspond to a connection in your database configuration options. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'connection' => env('SESSION_CONNECTION', null), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Database Table |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| When using the "database" session driver, you may specify the table we |
||||||
|
| should use to manage the sessions. Of course, a sensible default is |
||||||
|
| provided for you; however, you are free to change this as needed. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'table' => 'sessions', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Cache Store |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| While using one of the framework's cache driven session backends you may |
||||||
|
| list a cache store that should be used for these sessions. This value |
||||||
|
| must match with one of the application's configured cache "stores". |
||||||
|
| |
||||||
|
| Affects: "apc", "dynamodb", "memcached", "redis" |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'store' => env('SESSION_STORE', null), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Sweeping Lottery |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Some session drivers must manually sweep their storage location to get |
||||||
|
| rid of old sessions from storage. Here are the chances that it will |
||||||
|
| happen on a given request. By default, the odds are 2 out of 100. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'lottery' => [2, 100], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Cookie Name |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may change the name of the cookie used to identify a session |
||||||
|
| instance by ID. The name specified here will get used every time a |
||||||
|
| new session cookie is created by the framework for every driver. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'cookie' => env( |
||||||
|
'SESSION_COOKIE', |
||||||
|
Str::slug(env('APP_NAME', 'laravel'), '_').'_session' |
||||||
|
), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Cookie Path |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| The session cookie path determines the path for which the cookie will |
||||||
|
| be regarded as available. Typically, this will be the root path of |
||||||
|
| your application but you are free to change this when necessary. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'path' => '/', |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Session Cookie Domain |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Here you may change the domain of the cookie used to identify a session |
||||||
|
| in your application. This will determine which domains the cookie is |
||||||
|
| available to in your application. A sensible default has been set. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'domain' => env('SESSION_DOMAIN', null), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| HTTPS Only Cookies |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| By setting this option to true, session cookies will only be sent back |
||||||
|
| to the server if the browser has a HTTPS connection. This will keep |
||||||
|
| the cookie from being sent to you if it can not be done securely. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'secure' => env('SESSION_SECURE_COOKIE'), |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| HTTP Access Only |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Setting this value to true will prevent JavaScript from accessing the |
||||||
|
| value of the cookie and the cookie will only be accessible through |
||||||
|
| the HTTP protocol. You are free to modify this option if needed. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'http_only' => true, |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Same-Site Cookies |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option determines how your cookies behave when cross-site requests |
||||||
|
| take place, and can be used to mitigate CSRF attacks. By default, we |
||||||
|
| will set this value to "lax" since this is a secure default value. |
||||||
|
| |
||||||
|
| Supported: "lax", "strict", "none", null |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'same_site' => 'lax', |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,36 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
return [ |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| View Storage Paths |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Most templating systems load templates from disk. Here you may specify |
||||||
|
| an array of paths that should be checked for your views. Of course |
||||||
|
| the usual Laravel view path has already been registered for you. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'paths' => [ |
||||||
|
resource_path('views'), |
||||||
|
], |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Compiled View Path |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This option determines where all the compiled Blade templates will be |
||||||
|
| stored for your application. Typically, this is within the storage |
||||||
|
| directory. However, as usual, you are free to change this value. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
'compiled' => env( |
||||||
|
'VIEW_COMPILED_PATH', |
||||||
|
realpath(storage_path('framework/views')) |
||||||
|
), |
||||||
|
|
||||||
|
]; |
@ -0,0 +1,2 @@ |
|||||||
|
*.sqlite |
||||||
|
*.sqlite-journal |
@ -0,0 +1,28 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/** @var \Illuminate\Database\Eloquent\Factory $factory */ |
||||||
|
|
||||||
|
use App\User; |
||||||
|
use Faker\Generator as Faker; |
||||||
|
use Illuminate\Support\Str; |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Model Factories |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| This directory should contain each of the model factory definitions for |
||||||
|
| your application. Factories provide a convenient way to generate new |
||||||
|
| model instances for testing / seeding your application's database. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$factory->define(User::class, function (Faker $faker) { |
||||||
|
return [ |
||||||
|
'name' => $faker->name, |
||||||
|
'email' => $faker->unique()->safeEmail, |
||||||
|
'email_verified_at' => now(), |
||||||
|
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password |
||||||
|
'remember_token' => Str::random(10), |
||||||
|
]; |
||||||
|
}); |
@ -0,0 +1,40 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class CreateUsersTable extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::create('users', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->string('uid', 20)->unique(); |
||||||
|
$table->string('name'); |
||||||
|
$table->string('email')->unique(); |
||||||
|
$table->string('username')->unique(); |
||||||
|
$table->string('sex', 1); |
||||||
|
$table->timestamp('email_verified_at')->nullable(); |
||||||
|
$table->string('role', 20); |
||||||
|
$table->string('password'); |
||||||
|
$table->rememberToken(); |
||||||
|
$table->timestamps(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::dropIfExists('users'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class CreatePasswordResetsTable extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::create('password_resets', function (Blueprint $table) { |
||||||
|
$table->string('email')->index(); |
||||||
|
$table->string('token'); |
||||||
|
$table->timestamp('created_at')->nullable(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::dropIfExists('password_resets'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class CreateFailedJobsTable extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::create('failed_jobs', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->text('connection'); |
||||||
|
$table->text('queue'); |
||||||
|
$table->longText('payload'); |
||||||
|
$table->longText('exception'); |
||||||
|
$table->timestamp('failed_at')->useCurrent(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::dropIfExists('failed_jobs'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class CreateIrsxesTable extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::create('irsxes', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->string('code'); |
||||||
|
$table->string('antibiotic'); |
||||||
|
$table->string('status'); |
||||||
|
$table->string('specimen'); |
||||||
|
$table->string('pathogen'); |
||||||
|
$table->string('age'); |
||||||
|
$table->string('country'); |
||||||
|
$table->integer('year'); |
||||||
|
$table->string('sex'); |
||||||
|
$table->integer('value'); |
||||||
|
$table->timestamps(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::dropIfExists('irsxes'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,38 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class CreateSampleFilesTable extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::create('sample_files', function (Blueprint $table) { |
||||||
|
$table->id(); |
||||||
|
$table->string('code'); |
||||||
|
$table->string('specimen'); |
||||||
|
$table->string('age'); |
||||||
|
$table->string('country'); |
||||||
|
$table->string('year'); |
||||||
|
$table->string('sex'); |
||||||
|
$table->integer('value'); |
||||||
|
$table->timestamps(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::dropIfExists('sample_files'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class AddChangePassColumn extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::table('users', function (Blueprint $table) { |
||||||
|
$table->string('change_pass')->nullable(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
Schema::table('users', function (Blueprint $table) { |
||||||
|
$table->dropColumn(['change_pass']); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,29 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration; |
||||||
|
use Illuminate\Database\Schema\Blueprint; |
||||||
|
use Illuminate\Support\Facades\Schema; |
||||||
|
|
||||||
|
class ChangeYear extends Migration |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Run the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function up() |
||||||
|
{ |
||||||
|
Schema::table('irsxes', function (Blueprint $table) { |
||||||
|
$table->integer('year')->change(); |
||||||
|
}); |
||||||
|
} |
||||||
|
/** |
||||||
|
* Reverse the migrations. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function down() |
||||||
|
{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
use Illuminate\Database\Seeder; |
||||||
|
|
||||||
|
class DatabaseSeeder extends Seeder |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Seed the application's database. |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function run() |
||||||
|
{ |
||||||
|
// $this->call(UserSeeder::class); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/** |
||||||
|
* Laravel - A PHP Framework For Web Artisans |
||||||
|
* |
||||||
|
* @package Laravel |
||||||
|
* @author Taylor Otwell <taylor@laravel.com> |
||||||
|
*/ |
||||||
|
|
||||||
|
$uri = urldecode( |
||||||
|
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) |
||||||
|
); |
||||||
|
|
||||||
|
// This file allows us to emulate Apache's "mod_rewrite" functionality from the |
||||||
|
// built-in PHP web server. This provides a convenient way to test a Laravel |
||||||
|
// application without having installed a "real" web server software here. |
||||||
|
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
require_once __DIR__.'/public/index.php'; |
@ -0,0 +1,26 @@ |
|||||||
|
{ |
||||||
|
"private": true, |
||||||
|
"scripts": { |
||||||
|
"dev": "npm run development", |
||||||
|
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", |
||||||
|
"watch": "npm run development -- --watch", |
||||||
|
"watch-poll": "npm run watch -- --watch-poll", |
||||||
|
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js", |
||||||
|
"prod": "npm run production", |
||||||
|
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" |
||||||
|
}, |
||||||
|
"devDependencies": { |
||||||
|
"axios": "^0.19", |
||||||
|
"bootstrap": "^4.0.0", |
||||||
|
"cross-env": "^7.0", |
||||||
|
"jquery": "^3.2", |
||||||
|
"laravel-mix": "^5.0.1", |
||||||
|
"lodash": "^4.17.13", |
||||||
|
"popper.js": "^1.12", |
||||||
|
"resolve-url-loader": "^2.3.1", |
||||||
|
"sass": "^1.20.1", |
||||||
|
"sass-loader": "^8.0.0", |
||||||
|
"vue": "^2.5.17", |
||||||
|
"vue-template-compiler": "^2.6.10" |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" |
||||||
|
bootstrap="vendor/autoload.php" |
||||||
|
colors="true" |
||||||
|
> |
||||||
|
<testsuites> |
||||||
|
<testsuite name="Unit"> |
||||||
|
<directory suffix="Test.php">./tests/Unit</directory> |
||||||
|
</testsuite> |
||||||
|
<testsuite name="Feature"> |
||||||
|
<directory suffix="Test.php">./tests/Feature</directory> |
||||||
|
</testsuite> |
||||||
|
</testsuites> |
||||||
|
<filter> |
||||||
|
<whitelist processUncoveredFilesFromWhitelist="true"> |
||||||
|
<directory suffix=".php">./app</directory> |
||||||
|
</whitelist> |
||||||
|
</filter> |
||||||
|
<php> |
||||||
|
<server name="APP_ENV" value="testing"/> |
||||||
|
<server name="BCRYPT_ROUNDS" value="4"/> |
||||||
|
<server name="CACHE_DRIVER" value="array"/> |
||||||
|
<server name="DB_CONNECTION" value="sqlite"/> |
||||||
|
<server name="DB_DATABASE" value=":memory:"/> |
||||||
|
<server name="MAIL_MAILER" value="array"/> |
||||||
|
<server name="QUEUE_CONNECTION" value="sync"/> |
||||||
|
<server name="SESSION_DRIVER" value="array"/> |
||||||
|
<server name="TELESCOPE_ENABLED" value="false"/> |
||||||
|
</php> |
||||||
|
</phpunit> |
@ -0,0 +1,21 @@ |
|||||||
|
<IfModule mod_rewrite.c> |
||||||
|
<IfModule mod_negotiation.c> |
||||||
|
Options -MultiViews -Indexes |
||||||
|
</IfModule> |
||||||
|
|
||||||
|
RewriteEngine On |
||||||
|
|
||||||
|
# Handle Authorization Header |
||||||
|
RewriteCond %{HTTP:Authorization} . |
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
||||||
|
|
||||||
|
# Redirect Trailing Slashes If Not A Folder... |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d |
||||||
|
RewriteCond %{REQUEST_URI} (.+)/$ |
||||||
|
RewriteRule ^ %1 [L,R=301] |
||||||
|
|
||||||
|
# Send Requests To Front Controller... |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d |
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f |
||||||
|
RewriteRule ^ index.php [L] |
||||||
|
</IfModule> |
@ -0,0 +1,60 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/** |
||||||
|
* Laravel - A PHP Framework For Web Artisans |
||||||
|
* |
||||||
|
* @package Laravel |
||||||
|
* @author Taylor Otwell <taylor@laravel.com> |
||||||
|
*/ |
||||||
|
|
||||||
|
define('LARAVEL_START', microtime(true)); |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Register The Auto Loader |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Composer provides a convenient, automatically generated class loader for |
||||||
|
| our application. We just need to utilize it! We'll simply require it |
||||||
|
| into the script here so that we don't have to worry about manual |
||||||
|
| loading any of our classes later on. It feels great to relax. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
require __DIR__.'/../vendor/autoload.php'; |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Turn On The Lights |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| We need to illuminate PHP development, so let us turn on the lights. |
||||||
|
| This bootstraps the framework and gets it ready for use, then it |
||||||
|
| will load up this application so that we can run it and send |
||||||
|
| the responses back to the browser and delight our users. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$app = require_once __DIR__.'/../bootstrap/app.php'; |
||||||
|
|
||||||
|
/* |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| Run The Application |
||||||
|
|-------------------------------------------------------------------------- |
||||||
|
| |
||||||
|
| Once we have the application, we can handle the incoming request |
||||||
|
| through the kernel, and send the associated response back to |
||||||
|
| the client's browser allowing them to enjoy the creative |
||||||
|
| and wonderful application we have prepared for them. |
||||||
|
| |
||||||
|
*/ |
||||||
|
|
||||||
|
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); |
||||||
|
|
||||||
|
$response = $kernel->handle( |
||||||
|
$request = Illuminate\Http\Request::capture() |
||||||
|
); |
||||||
|
|
||||||
|
$response->send(); |
||||||
|
|
||||||
|
$kernel->terminate($request, $response); |
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,18 @@ |
|||||||
|
{ |
||||||
|
"name": "Flot", |
||||||
|
"version": "0.8.3", |
||||||
|
"main": "jquery.flot.js", |
||||||
|
"dependencies": { |
||||||
|
"jquery": ">= 1.2.6" |
||||||
|
}, |
||||||
|
"homepage": "https://github.com/flot/flot", |
||||||
|
"_release": "0.8.3", |
||||||
|
"_resolution": { |
||||||
|
"type": "version", |
||||||
|
"tag": "v0.8.3", |
||||||
|
"commit": "453b017cc5acfd75e252b93e8635f57f4196d45d" |
||||||
|
}, |
||||||
|
"_source": "https://github.com/flot/flot.git", |
||||||
|
"_target": "^0.8.3", |
||||||
|
"_originalSource": "flot" |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
language: node_js |
||||||
|
node_js: |
||||||
|
- 0.8 |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,98 @@ |
|||||||
|
## Contributing to Flot ## |
||||||
|
|
||||||
|
We welcome all contributions, but following these guidelines results in less |
||||||
|
work for us, and a faster and better response. |
||||||
|
|
||||||
|
### Issues ### |
||||||
|
|
||||||
|
Issues are not a way to ask general questions about Flot. If you see unexpected |
||||||
|
behavior but are not 100% certain that it is a bug, please try posting to the |
||||||
|
[forum](http://groups.google.com/group/flot-graphs) first, and confirm that |
||||||
|
what you see is really a Flot problem before creating a new issue for it. When |
||||||
|
reporting a bug, please include a working demonstration of the problem, if |
||||||
|
possible, or at least a clear description of the options you're using and the |
||||||
|
environment (browser and version, jQuery version, other libraries) that you're |
||||||
|
running under. |
||||||
|
|
||||||
|
If you have suggestions for new features, or changes to existing ones, we'd |
||||||
|
love to hear them! Please submit each suggestion as a separate new issue. |
||||||
|
|
||||||
|
If you would like to work on an existing issue, please make sure it is not |
||||||
|
already assigned to someone else. If an issue is assigned to someone, that |
||||||
|
person has already started working on it. So, pick unassigned issues to prevent |
||||||
|
duplicated effort. |
||||||
|
|
||||||
|
### Pull Requests ### |
||||||
|
|
||||||
|
To make merging as easy as possible, please keep these rules in mind: |
||||||
|
|
||||||
|
1. Submit new features or architectural changes to the *<version>-work* |
||||||
|
branch for the next major release. Submit bug fixes to the master branch. |
||||||
|
|
||||||
|
2. Divide larger changes into a series of small, logical commits with |
||||||
|
descriptive messages. |
||||||
|
|
||||||
|
3. Rebase, if necessary, before submitting your pull request, to reduce the |
||||||
|
work we need to do to merge it. |
||||||
|
|
||||||
|
4. Format your code according to the style guidelines below. |
||||||
|
|
||||||
|
### Flot Style Guidelines ### |
||||||
|
|
||||||
|
Flot follows the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines), |
||||||
|
with the following updates and exceptions: |
||||||
|
|
||||||
|
#### Spacing #### |
||||||
|
|
||||||
|
Use four-space indents, no tabs. Do not add horizontal space around parameter |
||||||
|
lists, loop definitions, or array/object indices. For example: |
||||||
|
|
||||||
|
```js |
||||||
|
for ( var i = 0; i < data.length; i++ ) { // This block is wrong! |
||||||
|
if ( data[ i ] > 1 ) { |
||||||
|
data[ i ] = 2; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
for (var i = 0; i < data.length; i++) { // This block is correct! |
||||||
|
if (data[i] > 1) { |
||||||
|
data[i] = 2; |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
#### Comments #### |
||||||
|
|
||||||
|
Use [jsDoc](http://usejsdoc.org) comments for all file and function headers. |
||||||
|
Use // for all inline and block comments, regardless of length. |
||||||
|
|
||||||
|
All // comment blocks should have an empty line above *and* below them. For |
||||||
|
example: |
||||||
|
|
||||||
|
```js |
||||||
|
var a = 5; |
||||||
|
|
||||||
|
// We're going to loop here |
||||||
|
// TODO: Make this loop faster, better, stronger! |
||||||
|
|
||||||
|
for (var x = 0; x < 10; x++) {} |
||||||
|
``` |
||||||
|
|
||||||
|
#### Wrapping #### |
||||||
|
|
||||||
|
Block comments should be wrapped at 80 characters. |
||||||
|
|
||||||
|
Code should attempt to wrap at 80 characters, but may run longer if wrapping |
||||||
|
would hurt readability more than having to scroll horizontally. This is a |
||||||
|
judgement call made on a situational basis. |
||||||
|
|
||||||
|
Statements containing complex logic should not be wrapped arbitrarily if they |
||||||
|
do not exceed 80 characters. For example: |
||||||
|
|
||||||
|
```js |
||||||
|
if (a == 1 && // This block is wrong! |
||||||
|
b == 2 && |
||||||
|
c == 3) {} |
||||||
|
|
||||||
|
if (a == 1 && b == 2 && c == 3) {} // This block is correct! |
||||||
|
``` |
@ -0,0 +1,75 @@ |
|||||||
|
## Frequently asked questions ## |
||||||
|
|
||||||
|
#### How much data can Flot cope with? #### |
||||||
|
|
||||||
|
Flot will happily draw everything you send to it so the answer |
||||||
|
depends on the browser. The excanvas emulation used for IE (built with |
||||||
|
VML) makes IE by far the slowest browser so be sure to test with that |
||||||
|
if IE users are in your target group (for large plots in IE, you can |
||||||
|
also check out Flashcanvas which may be faster). |
||||||
|
|
||||||
|
1000 points is not a problem, but as soon as you start having more |
||||||
|
points than the pixel width, you should probably start thinking about |
||||||
|
downsampling/aggregation as this is near the resolution limit of the |
||||||
|
chart anyway. If you downsample server-side, you also save bandwidth. |
||||||
|
|
||||||
|
|
||||||
|
#### Flot isn't working when I'm using JSON data as source! #### |
||||||
|
|
||||||
|
Actually, Flot loves JSON data, you just got the format wrong. |
||||||
|
Double check that you're not inputting strings instead of numbers, |
||||||
|
like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and |
||||||
|
the error might not show up immediately because Javascript can do some |
||||||
|
conversion automatically. |
||||||
|
|
||||||
|
|
||||||
|
#### Can I export the graph? #### |
||||||
|
|
||||||
|
You can grab the image rendered by the canvas element used by Flot |
||||||
|
as a PNG or JPEG (remember to set a background). Note that it won't |
||||||
|
include anything not drawn in the canvas (such as the legend). And it |
||||||
|
doesn't work with excanvas which uses VML, but you could try |
||||||
|
Flashcanvas. |
||||||
|
|
||||||
|
|
||||||
|
#### The bars are all tiny in time mode? #### |
||||||
|
|
||||||
|
It's not really possible to determine the bar width automatically. |
||||||
|
So you have to set the width with the barWidth option which is NOT in |
||||||
|
pixels, but in the units of the x axis (or the y axis for horizontal |
||||||
|
bars). For time mode that's milliseconds so the default value of 1 |
||||||
|
makes the bars 1 millisecond wide. |
||||||
|
|
||||||
|
|
||||||
|
#### Can I use Flot with libraries like Mootools or Prototype? #### |
||||||
|
|
||||||
|
Yes, Flot supports it out of the box and it's easy! Just use jQuery |
||||||
|
instead of $, e.g. call jQuery.plot instead of $.plot and use |
||||||
|
jQuery(something) instead of $(something). As a convenience, you can |
||||||
|
put in a DOM element for the graph placeholder where the examples and |
||||||
|
the API documentation are using jQuery objects. |
||||||
|
|
||||||
|
Depending on how you include jQuery, you may have to add one line of |
||||||
|
code to prevent jQuery from overwriting functions from the other |
||||||
|
libraries, see the documentation in jQuery ("Using jQuery with other |
||||||
|
libraries") for details. |
||||||
|
|
||||||
|
|
||||||
|
#### Flot doesn't work with [insert name of Javascript UI framework]! #### |
||||||
|
|
||||||
|
Flot is using standard HTML to make charts. If this is not working, |
||||||
|
it's probably because the framework you're using is doing something |
||||||
|
weird with the DOM or with the CSS that is interfering with Flot. |
||||||
|
|
||||||
|
A common problem is that there's display:none on a container until the |
||||||
|
user does something. Many tab widgets work this way, and there's |
||||||
|
nothing wrong with it - you just can't call Flot inside a display:none |
||||||
|
container as explained in the README so you need to hold off the Flot |
||||||
|
call until the container is actually displayed (or use |
||||||
|
visibility:hidden instead of display:none or move the container |
||||||
|
off-screen). |
||||||
|
|
||||||
|
If you find there's a specific thing we can do to Flot to help, feel |
||||||
|
free to submit a bug report. Otherwise, you're welcome to ask for help |
||||||
|
on the forum/mailing list, but please don't submit a bug report to |
||||||
|
Flot. |
@ -0,0 +1,22 @@ |
|||||||
|
Copyright (c) 2007-2014 IOLA and Ole Laursen |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person |
||||||
|
obtaining a copy of this software and associated documentation |
||||||
|
files (the "Software"), to deal in the Software without |
||||||
|
restriction, including without limitation the rights to use, |
||||||
|
copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||||
|
copies of the Software, and to permit persons to whom the |
||||||
|
Software is furnished to do so, subject to the following |
||||||
|
conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be |
||||||
|
included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
||||||
|
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
||||||
|
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
||||||
|
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
||||||
|
OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,12 @@ |
|||||||
|
# Makefile for generating minified files
|
||||||
|
|
||||||
|
.PHONY: all |
||||||
|
|
||||||
|
# we cheat and process all .js files instead of an exhaustive list
|
||||||
|
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js))) |
||||||
|
|
||||||
|
%.min.js: %.js |
||||||
|
yui-compressor $< -o $@
|
||||||
|
|
||||||
|
test: |
||||||
|
./node_modules/.bin/jshint *jquery.flot.js
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,143 @@ |
|||||||
|
## Writing plugins ## |
||||||
|
|
||||||
|
All you need to do to make a new plugin is creating an init function |
||||||
|
and a set of options (if needed), stuffing it into an object and |
||||||
|
putting it in the $.plot.plugins array. For example: |
||||||
|
|
||||||
|
```js |
||||||
|
function myCoolPluginInit(plot) { |
||||||
|
plot.coolstring = "Hello!"; |
||||||
|
}; |
||||||
|
|
||||||
|
$.plot.plugins.push({ init: myCoolPluginInit, options: { ... } }); |
||||||
|
|
||||||
|
// if $.plot is called, it will return a plot object with the |
||||||
|
// attribute "coolstring" |
||||||
|
``` |
||||||
|
|
||||||
|
Now, given that the plugin might run in many different places, it's |
||||||
|
a good idea to avoid leaking names. The usual trick here is wrap the |
||||||
|
above lines in an anonymous function which is called immediately, like |
||||||
|
this: (function () { inner code ... })(). To make it even more robust |
||||||
|
in case $ is not bound to jQuery but some other Javascript library, we |
||||||
|
can write it as |
||||||
|
|
||||||
|
```js |
||||||
|
(function ($) { |
||||||
|
// plugin definition |
||||||
|
// ... |
||||||
|
})(jQuery); |
||||||
|
``` |
||||||
|
|
||||||
|
There's a complete example below, but you should also check out the |
||||||
|
plugins bundled with Flot. |
||||||
|
|
||||||
|
|
||||||
|
## Complete example ## |
||||||
|
|
||||||
|
Here is a simple debug plugin which alerts each of the series in the |
||||||
|
plot. It has a single option that control whether it is enabled and |
||||||
|
how much info to output: |
||||||
|
|
||||||
|
```js |
||||||
|
(function ($) { |
||||||
|
function init(plot) { |
||||||
|
var debugLevel = 1; |
||||||
|
|
||||||
|
function checkDebugEnabled(plot, options) { |
||||||
|
if (options.debug) { |
||||||
|
debugLevel = options.debug; |
||||||
|
plot.hooks.processDatapoints.push(alertSeries); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function alertSeries(plot, series, datapoints) { |
||||||
|
var msg = "series " + series.label; |
||||||
|
if (debugLevel > 1) { |
||||||
|
msg += " with " + series.data.length + " points"; |
||||||
|
alert(msg); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
plot.hooks.processOptions.push(checkDebugEnabled); |
||||||
|
} |
||||||
|
|
||||||
|
var options = { debug: 0 }; |
||||||
|
|
||||||
|
$.plot.plugins.push({ |
||||||
|
init: init, |
||||||
|
options: options, |
||||||
|
name: "simpledebug", |
||||||
|
version: "0.1" |
||||||
|
}); |
||||||
|
})(jQuery); |
||||||
|
``` |
||||||
|
|
||||||
|
We also define "name" and "version". It's not used by Flot, but might |
||||||
|
be helpful for other plugins in resolving dependencies. |
||||||
|
|
||||||
|
Put the above in a file named "jquery.flot.debug.js", include it in an |
||||||
|
HTML page and then it can be used with: |
||||||
|
|
||||||
|
```js |
||||||
|
$.plot($("#placeholder"), [...], { debug: 2 }); |
||||||
|
``` |
||||||
|
|
||||||
|
This simple plugin illustrates a couple of points: |
||||||
|
|
||||||
|
- It uses the anonymous function trick to avoid name pollution. |
||||||
|
- It can be enabled/disabled through an option. |
||||||
|
- Variables in the init function can be used to store plot-specific |
||||||
|
state between the hooks. |
||||||
|
|
||||||
|
The two last points are important because there may be multiple plots |
||||||
|
on the same page, and you'd want to make sure they are not mixed up. |
||||||
|
|
||||||
|
|
||||||
|
## Shutting down a plugin ## |
||||||
|
|
||||||
|
Each plot object has a shutdown hook which is run when plot.shutdown() |
||||||
|
is called. This usually mostly happens in case another plot is made on |
||||||
|
top of an existing one. |
||||||
|
|
||||||
|
The purpose of the hook is to give you a chance to unbind any event |
||||||
|
handlers you've registered and remove any extra DOM things you've |
||||||
|
inserted. |
||||||
|
|
||||||
|
The problem with event handlers is that you can have registered a |
||||||
|
handler which is run in some point in the future, e.g. with |
||||||
|
setTimeout(). Meanwhile, the plot may have been shutdown and removed, |
||||||
|
but because your event handler is still referencing it, it can't be |
||||||
|
garbage collected yet, and worse, if your handler eventually runs, it |
||||||
|
may overwrite stuff on a completely different plot. |
||||||
|
|
||||||
|
|
||||||
|
## Some hints on the options ## |
||||||
|
|
||||||
|
Plugins should always support appropriate options to enable/disable |
||||||
|
them because the plugin user may have several plots on the same page |
||||||
|
where only one should use the plugin. In most cases it's probably a |
||||||
|
good idea if the plugin is turned off rather than on per default, just |
||||||
|
like most of the powerful features in Flot. |
||||||
|
|
||||||
|
If the plugin needs options that are specific to each series, like the |
||||||
|
points or lines options in core Flot, you can put them in "series" in |
||||||
|
the options object, e.g. |
||||||
|
|
||||||
|
```js |
||||||
|
var options = { |
||||||
|
series: { |
||||||
|
downsample: { |
||||||
|
algorithm: null, |
||||||
|
maxpoints: 1000 |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
Then they will be copied by Flot into each series, providing default |
||||||
|
values in case none are specified. |
||||||
|
|
||||||
|
Think hard and long about naming the options. These names are going to |
||||||
|
be public API, and code is going to depend on them if the plugin is |
||||||
|
successful. |
@ -0,0 +1,110 @@ |
|||||||
|
# Flot [](https://travis-ci.org/flot/flot) |
||||||
|
|
||||||
|
## About ## |
||||||
|
|
||||||
|
Flot is a Javascript plotting library for jQuery. |
||||||
|
Read more at the website: <http://www.flotcharts.org/> |
||||||
|
|
||||||
|
Take a look at the the examples in examples/index.html; they should give a good |
||||||
|
impression of what Flot can do, and the source code of the examples is probably |
||||||
|
the fastest way to learn how to use Flot. |
||||||
|
|
||||||
|
|
||||||
|
## Installation ## |
||||||
|
|
||||||
|
Just include the Javascript file after you've included jQuery. |
||||||
|
|
||||||
|
Generally, all browsers that support the HTML5 canvas tag are |
||||||
|
supported. |
||||||
|
|
||||||
|
For support for Internet Explorer < 9, you can use [Excanvas] |
||||||
|
[excanvas], a canvas emulator; this is used in the examples bundled |
||||||
|
with Flot. You just include the excanvas script like this: |
||||||
|
|
||||||
|
```html |
||||||
|
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]--> |
||||||
|
``` |
||||||
|
|
||||||
|
If it's not working on your development IE 6.0, check that it has |
||||||
|
support for VML which Excanvas is relying on. It appears that some |
||||||
|
stripped down versions used for test environments on virtual machines |
||||||
|
lack the VML support. |
||||||
|
|
||||||
|
You can also try using [Flashcanvas][flashcanvas], which uses Flash to |
||||||
|
do the emulation. Although Flash can be a bit slower to load than VML, |
||||||
|
if you've got a lot of points, the Flash version can be much faster |
||||||
|
overall. Flot contains some wrapper code for activating Excanvas which |
||||||
|
Flashcanvas is compatible with. |
||||||
|
|
||||||
|
You need at least jQuery 1.2.6, but try at least 1.3.2 for interactive |
||||||
|
charts because of performance improvements in event handling. |
||||||
|
|
||||||
|
|
||||||
|
## Basic usage ## |
||||||
|
|
||||||
|
Create a placeholder div to put the graph in: |
||||||
|
|
||||||
|
```html |
||||||
|
<div id="placeholder"></div> |
||||||
|
``` |
||||||
|
|
||||||
|
You need to set the width and height of this div, otherwise the plot |
||||||
|
library doesn't know how to scale the graph. You can do it inline like |
||||||
|
this: |
||||||
|
|
||||||
|
```html |
||||||
|
<div id="placeholder" style="width:600px;height:300px"></div> |
||||||
|
``` |
||||||
|
|
||||||
|
You can also do it with an external stylesheet. Make sure that the |
||||||
|
placeholder isn't within something with a display:none CSS property - |
||||||
|
in that case, Flot has trouble measuring label dimensions which |
||||||
|
results in garbled looks and might have trouble measuring the |
||||||
|
placeholder dimensions which is fatal (it'll throw an exception). |
||||||
|
|
||||||
|
Then when the div is ready in the DOM, which is usually on document |
||||||
|
ready, run the plot function: |
||||||
|
|
||||||
|
```js |
||||||
|
$.plot($("#placeholder"), data, options); |
||||||
|
``` |
||||||
|
|
||||||
|
Here, data is an array of data series and options is an object with |
||||||
|
settings if you want to customize the plot. Take a look at the |
||||||
|
examples for some ideas of what to put in or look at the |
||||||
|
[API reference](API.md). Here's a quick example that'll draw a line |
||||||
|
from (0, 0) to (1, 1): |
||||||
|
|
||||||
|
```js |
||||||
|
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } }); |
||||||
|
``` |
||||||
|
|
||||||
|
The plot function immediately draws the chart and then returns a plot |
||||||
|
object with a couple of methods. |
||||||
|
|
||||||
|
|
||||||
|
## What's with the name? ## |
||||||
|
|
||||||
|
First: it's pronounced with a short o, like "plot". Not like "flawed". |
||||||
|
|
||||||
|
So "Flot" rhymes with "plot". |
||||||
|
|
||||||
|
And if you look up "flot" in a Danish-to-English dictionary, some of |
||||||
|
the words that come up are "good-looking", "attractive", "stylish", |
||||||
|
"smart", "impressive", "extravagant". One of the main goals with Flot |
||||||
|
is pretty looks. |
||||||
|
|
||||||
|
|
||||||
|
## Notes about the examples ## |
||||||
|
|
||||||
|
In order to have a useful, functional example of time-series plots using time |
||||||
|
zones, date.js from [timezone-js][timezone-js] (released under the Apache 2.0 |
||||||
|
license) and the [Olson][olson] time zone database (released to the public |
||||||
|
domain) have been included in the examples directory. They are used in |
||||||
|
examples/axes-time-zones/index.html. |
||||||
|
|
||||||
|
|
||||||
|
[excanvas]: http://code.google.com/p/explorercanvas/ |
||||||
|
[flashcanvas]: http://code.google.com/p/flashcanvas/ |
||||||
|
[timezone-js]: https://github.com/mde/timezone-js |
||||||
|
[olson]: http://ftp.iana.org/time-zones |
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"name": "Flot", |
||||||
|
"version": "0.8.3", |
||||||
|
"main": "jquery.flot.js", |
||||||
|
"dependencies": { |
||||||
|
"jquery": ">= 1.2.6" |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Europe (EU27)", |
||||||
|
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "Japan", |
||||||
|
"data": [[1999, -0.1], [2000, 2.9], [2001, 0.2], [2002, 0.3], [2003, 1.4], [2004, 2.7], [2005, 1.9], [2006, 2.0], [2007, 2.3], [2008, -0.7]] |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
{ |
||||||
|
"label": "USA", |
||||||
|
"data": [[1999, 4.4], [2000, 3.7], [2001, 0.8], [2002, 1.6], [2003, 2.5], [2004, 3.6], [2005, 2.9], [2006, 2.8], [2007, 2.0], [2008, 1.1]] |
||||||
|
} |
@ -0,0 +1,173 @@ |
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||||
|
<title>Flot Examples: AJAX</title> |
||||||
|
<link href="../examples.css" rel="stylesheet" type="text/css"> |
||||||
|
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]--> |
||||||
|
<script language="javascript" type="text/javascript" src="../../jquery.js"></script> |
||||||
|
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script> |
||||||
|
<script type="text/javascript"> |
||||||
|
|
||||||
|
$(function() { |
||||||
|
|
||||||
|
var options = { |
||||||
|
lines: { |
||||||
|
show: true |
||||||
|
}, |
||||||
|
points: { |
||||||
|
show: true |
||||||
|
}, |
||||||
|
xaxis: { |
||||||
|
tickDecimals: 0, |
||||||
|
tickSize: 1 |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
var data = []; |
||||||
|
|
||||||
|
$.plot("#placeholder", data, options); |
||||||
|
|
||||||
|
// Fetch one series, adding to what we already have |
||||||
|
|
||||||
|
var alreadyFetched = {}; |
||||||
|
|
||||||
|
$("button.fetchSeries").click(function () { |
||||||
|
|
||||||
|
var button = $(this); |
||||||
|
|
||||||
|
// Find the URL in the link right next to us, then fetch the data |
||||||
|
|
||||||
|
var dataurl = button.siblings("a").attr("href"); |
||||||
|
|
||||||
|
function onDataReceived(series) { |
||||||
|
|
||||||
|
// Extract the first coordinate pair; jQuery has parsed it, so |
||||||
|
// the data is now just an ordinary JavaScript object |
||||||
|
|
||||||
|
var firstcoordinate = "(" + series.data[0][0] + ", " + series.data[0][1] + ")"; |
||||||
|
button.siblings("span").text("Fetched " + series.label + ", first point: " + firstcoordinate); |
||||||
|
|
||||||
|
// Push the new data onto our existing data array |
||||||
|
|
||||||
|
if (!alreadyFetched[series.label]) { |
||||||
|
alreadyFetched[series.label] = true; |
||||||
|
data.push(series); |
||||||
|
} |
||||||
|
|
||||||
|
$.plot("#placeholder", data, options); |
||||||
|
} |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: dataurl, |
||||||
|
type: "GET", |
||||||
|
dataType: "json", |
||||||
|
success: onDataReceived |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
// Initiate a recurring data update |
||||||
|
|
||||||
|
$("button.dataUpdate").click(function () { |
||||||
|
|
||||||
|
data = []; |
||||||
|
alreadyFetched = {}; |
||||||
|
|
||||||
|
$.plot("#placeholder", data, options); |
||||||
|
|
||||||
|
var iteration = 0; |
||||||
|
|
||||||
|
function fetchData() { |
||||||
|
|
||||||
|
++iteration; |
||||||
|
|
||||||
|
function onDataReceived(series) { |
||||||
|
|
||||||
|
// Load all the data in one pass; if we only got partial |
||||||
|
// data we could merge it with what we already have. |
||||||
|
|
||||||
|
data = [ series ]; |
||||||
|
$.plot("#placeholder", data, options); |
||||||
|
} |
||||||
|
|
||||||
|
// Normally we call the same URL - a script connected to a |
||||||
|
// database - but in this case we only have static example |
||||||
|
// files, so we need to modify the URL. |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: "data-eu-gdp-growth-" + iteration + ".json", |
||||||
|
type: "GET", |
||||||
|
dataType: "json", |
||||||
|
success: onDataReceived |
||||||
|
}); |
||||||
|
|
||||||
|
if (iteration < 5) { |
||||||
|
setTimeout(fetchData, 1000); |
||||||
|
} else { |
||||||
|
data = []; |
||||||
|
alreadyFetched = {}; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
setTimeout(fetchData, 1000); |
||||||
|
}); |
||||||
|
|
||||||
|
// Load the first series by default, so we don't have an empty plot |
||||||
|
|
||||||
|
$("button.fetchSeries:first").click(); |
||||||
|
|
||||||
|
// Add the Flot version string to the footer |
||||||
|
|
||||||
|
$("#footer").prepend("Flot " + $.plot.version + " – "); |
||||||
|
}); |
||||||
|
|
||||||
|
</script> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<div id="header"> |
||||||
|
<h2>AJAX</h2> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div id="content"> |
||||||
|
|
||||||
|
<div class="demo-container"> |
||||||
|
<div id="placeholder" class="demo-placeholder"></div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<p>Example of loading data dynamically with AJAX. Percentage change in GDP (source: <a href="http://epp.eurostat.ec.europa.eu/tgm/table.do?tab=table&init=1&plugin=1&language=en&pcode=tsieb020">Eurostat</a>). Click the buttons below:</p> |
||||||
|
|
||||||
|
<p>The data is fetched over HTTP, in this case directly from text files. Usually the URL would point to some web server handler (e.g. a PHP page or Java/.NET/Python/Ruby on Rails handler) that extracts it from a database and serializes it to JSON.</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
<button class="fetchSeries">First dataset</button> |
||||||
|
[ <a href="data-eu-gdp-growth.json">see data</a> ] |
||||||
|
<span></span> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
<button class="fetchSeries">Second dataset</button> |
||||||
|
[ <a href="data-japan-gdp-growth.json">see data</a> ] |
||||||
|
<span></span> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
<button class="fetchSeries">Third dataset</button> |
||||||
|
[ <a href="data-usa-gdp-growth.json">see data</a> ] |
||||||
|
<span></span> |
||||||
|
</p> |
||||||
|
|
||||||
|
<p>If you combine AJAX with setTimeout, you can poll the server for new data.</p> |
||||||
|
|
||||||
|
<p> |
||||||
|
<button class="dataUpdate">Poll for data</button> |
||||||
|
</p> |
||||||
|
|
||||||
|
</div> |
||||||
|
|
||||||
|
<div id="footer"> |
||||||
|
Copyright © 2007 - 2014 IOLA and Ole Laursen |
||||||
|
</div> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue