Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
| <?php | |
| namespace App\Providers\Auth; | |
| use Kbwebs\MultiAuth\MultiManager; | |
| use Tymon\JWTAuth\Providers\Auth\AuthInterface; | |
| class IlluminateAuthAdapter implements AuthInterface | |
| { | |
| /** |
| ... | |
| "autoload": { | |
| "files": [ | |
| "helpers.php" | |
| ] | |
| }, | |
| ... |
| <?php | |
| if (!function_exists('_dd')) { | |
| function _dd(...$args) | |
| { | |
| if (!headers_sent()) { | |
| header('HTTP/1.1 500 Internal Server Error'); | |
| } | |
| call_user_func_array('dd', $args); | |
| } | |
| } |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
| <title>Choose the Champ</title> | |
| <link rel="stylesheet" type="text/css" href="css/app.css"> |
| "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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | |
| "hot": "cross-env NODE_ENV=development webpack-dev-server --inline --hot --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 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | |
| } |
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import withRedux from 'next-redux-wrapper' | |
| import { initStore } from '../store/store' | |
| import App from 'next/app'; | |
| const MyApp = props => { | |
| const { Component, pageProps, store } = props | |
| return ( | |
| <Provider store={store}> |
| import withLayout from "../components/Layout"; | |
| import HomeComponent from "../components/home/Home"; | |
| import { addHomePage } from '../store/pages/action'; | |
| import api from '../api'; | |
| let Index = (props) => <HomeComponent {...props} />; | |
| Index.getInitialProps = async ({ store, isServer }) => { | |
| let homePage = store.getState().pages.homepage; |
Translations: Korean (by Yongwoo Lee)
Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.
I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).
| # request key: one_day / one_week / one_month / three_month / one_year | |
| # one_day | |
| # last 24 hrs data -- 24 data points, 1 per hour | |
| [ | |
| { | |
| time_point: "2022-04-14 00:00", | |
| value: 72, | |
| }, |