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 getConfig from 'next/config' | |
import axios from 'axios'; | |
import { isLoggedIn, logout } from './auth' | |
const { | |
publicRuntimeConfig: {API_URL}, // Available both client and server side | |
} = getConfig() | |
let axiosIntance = { ...axios} | |
axiosIntance.defaults.baseURL = API_URL |
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
root = true | |
[*] | |
indent_style = space | |
indent_size = 4 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use wanmigs\HealthCheck\SystemCheck; | |
use Illuminate\Support\Facades\DB; | |
class SystemController extends Controller | |
{ | |
private $system; |
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
let data = new FormData(); | |
data.append("_method", 'PATCH'); | |
// append another data .... | |
const headers = { | |
'Content-Type': 'multipart/form-data', | |
'enctype' : 'multipart/form-data', | |
'Authorization' : 'Bearer ' + token | |
} |
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
protected function getImagesFromMsg($msg) | |
{ | |
if (!empty($msg)) | |
{ | |
preg_match_all('/<img[^>]+>/i', stripcslashes($msg), $imgTags); | |
//All img tags | |
for ($i=0; $i < count($imgTags[0]); $i++) | |
{ | |
preg_match('/src="([^"]+)/i', $imgTags[0][$i], $withSrc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const requireContext = require.context('./', false, /.*\.(js)$/) | |
let components = {}; | |
requireContext.keys().forEach(fileName => { | |
if (fileName === './index.js') return | |
let name = fileName.replace(/(\.\/|\.js)/g, '') |
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; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
abstract class TestCase extends BaseTestCase | |
{ | |
use CreatesApplication; |
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\Traits; | |
use Illuminate\Http\Request; | |
use Illuminate\Pagination\Paginator; | |
trait Paginators | |
{ | |
private $sortBy = ['created_at' => 'desc']; |