This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CreateFunctionDoublequote extends Migration | |
{ | |
public function up() | |
{ | |
$query = <<<EOD | |
CREATE FUNCTION `DOUBLEQUOTE`(`val` TEXT) RETURNS TEXT CHARSET latin1 NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER RETURN CONCAT('"', REPLACE(val, '"', '\"'), '"') | |
EOD; | |
DB::unprepared($query); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> SELECT JSON_QUOTE('null'), JSON_QUOTE('"null"'); | |
+--------------------+----------------------+ | |
| JSON_QUOTE('null') | JSON_QUOTE('"null"') | | |
+--------------------+----------------------+ | |
| "null" | "\"null\"" | | |
+--------------------+----------------------+ | |
mysql> SELECT JSON_QUOTE('[1, 2, 3]'); | |
+-------------------------+ | |
| JSON_QUOTE('[1, 2, 3]') | | |
+-------------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Support\Str; | |
use Illuminate\Database\Eloquent\Model; | |
class Utils extends Model | |
{ | |
public static function getQueryGroupConcat($keyValues, $distinct = false){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\User; | |
use App\Utils; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Route; | |
Route::get('/users', function (Request $request) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use App\Mail\OrderShipped; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
use Illuminate\Support\Facades\Mail; | |
use Tests\TestCase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
const AuthGuard = ({component}) => { | |
useEffect(() => { | |
console.log("Auth Guard"); | |
}, []); | |
return <React.Fragment>{component}</React.Fragment> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
const Login = () => { | |
useEffect(() => { | |
console.log("Login"); | |
}, []); | |
return <div> Login Form </div> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Route } from "react-router-dom"; | |
import AuthGuard from "../guards/AuthGuard"; | |
import Welcome from "../pages/Welcome"; | |
const AuthRoutes = [ | |
<Route key="Welcome" path="/" element={<AuthGuard component={<Welcome />} />} /> | |
] | |
export default AuthRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Route } from "react-router-dom"; | |
import UnAuthGuard from "../guards/UnAuthGuard"; | |
import Login from "../pages/Login"; | |
import Register from "../pages/Register"; | |
const UnAuthRoutes = [ | |
<Route key="Login" path="/login" element={<UnAuthGuard component={<Login />} />} ></Route>, | |
<Route key="Register" path="/register" element={<UnAuthGuard component={<Register />} />} > </Route> | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
import { BrowserRouter, Routes } from 'react-router-dom'; | |
import AuthRoutes from './routes/AuthRoutes'; | |
import UnAuthRoutes from './routes/UnAuthRoutes'; | |
function App() { | |
return ( | |
<div className="App"> | |
<BrowserRouter> | |
<Routes> |
OlderNewer