Skip to content

Instantly share code, notes, and snippets.

View golonix's full-sized avatar

Michał Golon golonix

View GitHub Profile
<?php
Class AddressController
{
public function index(Request $request)
{
$user = Auth::user();
$addresses = Address::where("user_id", $user->id)->get();
return (new AddressResponder($request, $addresses))->respond();
@golonix
golonix / AdvancedAwesomeCommand.php
Created January 30, 2018 13:13
Artisan command with customized progress bar
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Helper\ProgressBar;
class AdvancedAwesomeCommand extends Command
{
@golonix
golonix / SimpleAwesomeCommand.php
Created January 30, 2018 09:38
Artisan command with simple progress bar
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SimpleAwesomeCommand extends Command
{
/**
* @var string

Keybase proof

I hereby claim:

  • I am golonix on github.
  • I am gollum (https://keybase.io/gollum) on keybase.
  • I have a public key ASAGThCgo1Iv42CmjrpC4t1IIqkX-gqA9m-NelDUhh7R3wo

To claim this, I am signing this object: