Skip to content

Instantly share code, notes, and snippets.

View DarkGhostHunter's full-sized avatar
👨‍💻
Hands full

Italo DarkGhostHunter

👨‍💻
Hands full
View GitHub Profile
@DarkGhostHunter
DarkGhostHunter / RegisterController.php
Last active May 22, 2018 18:11
56413a512688-RegisterController
<?php
namespace App\Http\Controllers
use App\User;
use App\Jobs\ProcessNewUser;
use App\Http\Controllers\Controller;
class RegisterController extends Controller {
// ...
@DarkGhostHunter
DarkGhostHunter / ProcessNewUser.php
Created May 22, 2018 18:04
56413a512688-ProcessNewUser
<?php
namespace App\Jobs;
use App\User;
use App\UserVisit;
use App\Accounting;
use App\Notifications\UserGreetingEmail;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
@DarkGhostHunter
DarkGhostHunter / UnregisterController.php
Created May 22, 2018 18:10
56413a512688-UnregisterController
<?php
namespace App\Http\Controllers
use App\User;
use App\Jobs\FarewellUser;
use App\Http\Controllers\Controller;
class UnregisterController extends Controller {
// ...
@DarkGhostHunter
DarkGhostHunter / FarewellUser.php
Created May 22, 2018 18:13
56413a512688-FarewellUser-A
<?php
namespace App\Jobs;
use App\User;
use App\UserVisit;
use App\Accounting;
use App\Notifications\UserFarewellEmail;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
@DarkGhostHunter
DarkGhostHunter / UserDeleted.php
Created May 22, 2018 18:22
56413a512688-UserDeleted
<?php
namespace App
use Illuminate\Database\Eloquent\Model;
class UserDeleted extends Model {
public $table = 'users_deleted';
public $casts = ['payload' => 'array'];
@DarkGhostHunter
DarkGhostHunter / Subscription.php
Created May 22, 2018 23:52
958dd096db-Subscription
<?php
namespace App\Pivots;
use Illuminate\Database\Eloquent\Relations\Pivot;
class Subscription extends Pivot {
public function user()
{
return $this->belongsTo('App\User');
@DarkGhostHunter
DarkGhostHunter / User.php
Last active March 17, 2023 07:09
958dd096db-User
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
// ...
@DarkGhostHunter
DarkGhostHunter / registerConnectionSerivces.php
Created September 19, 2018 15:54
Illuminate\Database\DatabaseServiceProvider@registerConnectionServices
<?php
/**
* Register the primary database bindings.
*
* @return void
*/
protected function registerConnectionServices()
{
// The connection factory is used to create the actual connection instances on
// the database. We will inject the factory into the manager so that it may
@DarkGhostHunter
DarkGhostHunter / DatabaseServiceProvider.php
Created September 19, 2018 17:19
Illuminate\Database\DatabaseServiceProvider@boot
<?php
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
Model::setConnectionResolver($this->app['db']);
Model::setEventDispatcher($this->app['events']);
@DarkGhostHunter
DarkGhostHunter / AbstractTest.php
Created November 26, 2018 17:55
Tests an Abstract Class
<?php
namespace Tests;
use PHPUnit\Framework\TestCase;
use MyVendor\MyPackage\AbstractClass;
class AbstractTest extends TestCase
{
protected $newAnonymousClassFromAbstract;