Skip to content

Instantly share code, notes, and snippets.

@akoepcke
akoepcke / RouteDirectives.php
Created January 23, 2020 16:16 — forked from calebporzio/RouteDirectives.php
Blade Route Directives
<?php
// Register these inside a service provider:
Blade::directive('route', function ($expression) {
return "<?php echo route({$expression}) ?>";
});
Blade::directive('routeIs', function ($expression) {
return "<?php if (request()->routeIs({$expression})) : ?>";
@akoepcke
akoepcke / LoginController.php
Created August 27, 2019 07:38
migrate md5 to bcrypt
protected function attemptLogin(Request $request)
{
$check = $this->guard()->attempt(
$this->credentials($request), $request->has('remember')
);
if ($check === false)
{
$user = User::where('username','=',$request->input('username'))->first();
if(isset($user)) {
Files:
find /path/to/root -type f -exec chmod 644 {} \;
Folders:
find /path/to/root -type d -exec chmod 755 {} \;
.htaccess (because of Ionos)
modify RewriteRule ^ index.php
to RewriteRule ^ /index.php
@akoepcke
akoepcke / .php_cs.laravel.php
Created July 22, 2019 10:07 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@akoepcke
akoepcke / .bash_profile
Created August 31, 2018 08:11
composer-link()
// Require local folder as Composer dependency
// whereas _package_ is a unique package ID to keep composer from overwriting existing config
//
// from within the project folder, run the following:
// composer-link /path/to/package package
// Then run composer require as usual.
composer-link() {
composer config repositories."$2" '{"type": "path", "url": "'$1'"}' --file composer.json
}