Skip to content

Instantly share code, notes, and snippets.

@stillfinder
stillfinder / frontControllerPath.php
Last active November 27, 2018 04:10
Drupal Valet ?q parameter
<?php
public function frontControllerPath($sitePath, $siteName, $uri)
{
$sitePath = $this->addSubdirectory($sitePath);
if (!isset($_GET['q']) && !empty($uri) && $uri !== '/') {
$_GET['q'] = $uri;
}
@stillfinder
stillfinder / LocalValetDriver.php
Last active November 27, 2018 04:12
Drupal + Valet
<?php
class LocalValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@stillfinder
stillfinder / create_laravel_app_valet.sh
Last active January 10, 2019 16:46
Install new Laravel project in Valet parked directory. (Setup DB, composer & yarn, create git repo)
#!/bin/bash
laravel new $1
cd $1
cp ../_ide_helper.php .
cp .env.example .env
composer install
yarn install
php artisan key:generate
@stillfinder
stillfinder / create_laravel_app.sh
Last active May 21, 2019 12:37
Create Laravel application
#!/bin/bash
laravel new $1
cd $1
cp ../_ide_helper.php .
cp .env.example .env
composer install
yarn install
php artisan key:generate