Updated 24-05-2020
NAME=$1
mkdir $NAME
cd $NAME
# Generate private key
<?php | |
# app/Http/Controllers/CaddyController.php | |
namespace App\Http\Controllers; | |
use App\Store; | |
use Illuminate\Http\Request; | |
class CaddyController extends Controller | |
{ |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker
now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
Here's how to overcome this common gotcha: The default password reset system not working out of the box with Laravel 5.x (as you're not sent the user's password), without having to alter altering vendor/core. Here's how to make it work as you'd expect it to without changing any vendor files.
Firstly create a new notification for your app:
php artisan make:notification ResetPassword
Then open the newly created file: app\Notifications\ResetPassword.php
and make the following changes:
--- | |
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
RepositoryBranch: | |
Type: String | |
Default: master | |
Cluster: |
# 1. Backup image tags to text file. | |
# $ docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" > img_id.txt | |
# | |
# 2. Execute clean-docker-for-mac script | |
# $ bash clean-docker-for-mac.sh $(docker images --format "{{.ID}}" | xargs) | |
# | |
# source: https://gist.github.com/MrTrustor/e690ba75cefe844086f5e7da909b35ce#file-clean-docker-for-mac-sh | |
# | |
# 3. Execute this script to restore tags from text file. |
function PrivateRoute ({component: Component, authenticated, ...rest}) { | |
return ( | |
<Route | |
{...rest} | |
render={(props) => authenticated === true | |
? <Component {...props} /> | |
: <Redirect to={{pathname: '/login', state: {from: props.location}}} />} | |
/> | |
) | |
} |
<!-- Smooth Scroll --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
// Add smooth scrolling to all links | |
$("a").on('click', function(event) { | |
// Make sure this.hash has a value before overriding default behavior | |
if (this.hash !== "learn") { | |
// Prevent default anchor click behavior |
<?php | |
/** | |
* Extend expiration length of the auth cookie for Administrators when hey check Remember Me | |
* | |
* @param int $expiration Cookie expiration passed by auth_cookie_expiration() hook | |
* @return int 90 days in seconds | |
*/ | |
function chuck_extend_admins_login_session( $expiration, $user_id, $remember ) { | |
if ( $remember && user_can( $user_id, 'manage_options' ) ) { |
Dockerfile
that is based on your production image and
simply install xdebug
into it. Exemple:FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \