###Edit this file
/etc/nginx/nginx.conf
###Add this line anywhere inside the http { }
block:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
###Go to your Forge panel and restart Nginx
# stop script on error signal | |
set -e | |
# delete deployment folder if script exit before end last time | |
if [ -d "/home/forge/deployment" ]; then | |
rm -R /home/forge/deployment | |
fi | |
# set up your env variables if your app using them | |
export DB_HOST=localhost |
###Edit this file
/etc/nginx/nginx.conf
###Add this line anywhere inside the http { }
block:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
###Go to your Forge panel and restart Nginx
<?php | |
function fy_shuffle(array &$array, $rand = 'mt_rand') { | |
$array = array_values($array); | |
for($i = count($array) - 1; $i > 0; --$i) { | |
$j = $rand(0, $i); | |
if($i !== $j) { | |
list($array[$i], $array[$j]) = array($array[$j], $array[$i]); | |
} | |
} | |
return true; |
(function(oldForEach) { | |
Array.prototype.forEach = function() { | |
oldForEach.apply(this, arguments); | |
return this; | |
}; | |
}(Array.prototype.forEach)); | |
[1, 2, 3] | |
.forEach(item => console.log(1, item)) | |
.forEach(item => console.log(2, item)) |
<?php namespace App\Http; | |
use Illuminate\Foundation\Http\Kernel as HttpKernel; | |
class Kernel extends HttpKernel | |
{ | |
protected $middleware = [ | |
\App\Http\Middleware\NewRelicPatch::class, | |
//... your other middlewares | |
]; |
Most apps should eventually have two or three sets of test suites: Unit tests, integration tests, and functional tests.
A note about examples:
We'll be using ES6 syntax just for reading simplicity. () =>
means function
, let
is block-scoped var
(used here just to remind the reader that we're talking about ES6), and (...args)
creates an args
array containing all the arguments that follow the ...
.
<?php | |
namespace Tests\Browser\Dusk; | |
use Tests\Testing\MailFake; | |
use Laravel\Dusk\Browser as BaseBrowser; | |
class Browser extends BaseBrowser { | |
public function fake($service) { |
import React from "react"; | |
import { request, GraphQLClient } from "graphql-request"; | |
export default class HomePage extends React.Component { | |
static async getInitialProps() { | |
const query = `{ | |
allPosts { | |
id | |
slug | |
coverImage { |
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Laravel 5, Bootstrap 4 Pagination | |
|-------------------------------------------------------------------------- | |
| | |
| A partial view to handle pagination for collections in Laravel's query | |
| builder or Eloquent ORM, styled with Bootstrap 4. | |
| | |
| The pagination displays like the following, where * denotes the current |