Skip to content

Instantly share code, notes, and snippets.

Avatar

Robin Bastiaan RobinBastiaan

View GitHub Profile
@RobinBastiaan
RobinBastiaan / Info for PHPStorm.md
Created November 24, 2022 20:46 — forked from Pen-y-Fan/Info for PHPStorm.md
PHPStorm Tips, Tricks and setup
View Info for PHPStorm.md

PHPStorm

PhpStorm Tips, ticks and standard setup

  1. Tips and Tracks for PHPStorm (PHPStorm Tips and Tricks.md)
  2. Standard setup for PHP projects (Standard.md)
@RobinBastiaan
RobinBastiaan / config.php
Created November 8, 2022 21:56 — forked from jarektkaczyk/config.php
Laravel - tinker like a boss (with PsySH)
View config.php
<?php // ~/.config/psysh/config.php
// Anything not Laravel - let's try to autoload something likely to exist
if (!defined('LARAVEL_START')) {
return [
'defaultIncludes' => [
getcwd().'/vendor/autoload.php',
getcwd().'/bootstrap/autoload.php',
],
];
View Laravel Best Practices
# Laravel Best Practices
Laravel is a PHP framework and just like any other PHP framework there are several ways to get a single thing done in a lot of cases, for conformity these are hand picked best practices.
1. Installation of every Laravel project should be done with:
```bash
composer create-project laravel/laravel {./} or {projectname-backend}
```
2. The project name should be in kebab cases in the format: `{projectname-backend}`
3. All file names should be in title cases **ProductController, PostService, Category**
4. All services should be named after model name if tied to a model, else it should carry the name of the entity, and the suffix 'Service' i.e. {Name}Service
@RobinBastiaan
RobinBastiaan / class-order.php
Created August 18, 2022 12:13 — forked from hkdobrev/class-order.php
PHP convention for the order in a class.
View class-order.php
<?php namespace Vendor\Library;
use Another\Vendor\Library\ClassName;
abstract class ClassName extends AnotherClass implements Countable, Serializable
{
const CONSTANTS = 'top';
use someTrait, anotherTrait {
anotherTrait::traitMethod insteadof someTrait;
View Configuration & Aliases.md

Configuration & Aliases

Various configuration and alias commands you can directly run from the command line.

Aliases are convenient shotcuts making you everyday work a little easier. This is especially true for commands that you use a lot and thus save you a lot of keystrokes, and for commands that are so long making them hard to remember and tidious to type. When designing an alias I make sure the abbreviation makes sence to me. In that way they are not too cryptic and makes sure I remember them more easily.

However, some commands can rewrite or delete your work. These commands always need your full attention in order to prevent problems. For these kind of commands, an alias should only be made with great consideration.

GIT CONFIGURATION