Skip to content

Instantly share code, notes, and snippets.

View opejovic's full-sized avatar
:octocat:
Work in progress

ognjen opejovic

:octocat:
Work in progress
View GitHub Profile

Access Google API: oauth, calendar and gmail

Create a project

image

image

Enable the Google Calendar API and Gmail API

Now, within that project, you will need to enable APIs and services. image

@opejovic
opejovic / Response.php
Created October 19, 2021 09:29 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
<div class="min-h-screen mx-auto relative overflow-x-hidden">
<div class="container mx-auto max-w-6xl">
<header class="mt-6 px-6 xl:px-4">
<nav class="flex justify-between items-center text-white">
<div>
<svg viewBox="0 0 60 25" xmlns="http://www.w3.org/2000/svg" width="60" height="25" class="UserLogo variant--">
<title>Stripe logo</title>
<path fill="var(--userLogoColor, #FFFFFF)" d="M59.64 14.28h-8.06c.19 1.93 1.6 2.55 3.2 2.55 1.64 0 2.96-.37 4.05-.95v3.32a8.33 8.33 0 0 1-4.56 1.1c-4.01 0-6.83-2.5-6.83-7.48 0-4.19 2.39-7.52 6.3-7.52 3.92 0 5.96 3.28 5.96 7.5 0 .4-.04 1.26-.06 1.48zm-5.92-5.62c-1.03 0-2.17.73-2.17 2.58h4.25c0-1.85-1.07-2.58-2.08-2.58zM40.95 20.3c-1.44 0-2.32-.6-2.9-1.04l-.02 4.63-4.12.87V5.57h3.76l.08 1.02a4.7 4.7 0 0 1 3.23-1.29c2.9 0 5.62 2.6 5.62 7.4 0 5.23-2.7 7.6-5.65 7.6zM40 8.95c-.95 0-1.54.34-1.97.81l.02 6.12c.4.44.98.78 1.95.78 1.52 0 2.54-1.65 2.54-3.87 0-2.15-1.04-3.84-2.54-3.84zM28.24 5.57h4.13v14.44h-4.13V5.57zm0-4.7L32.37 0
<?php
namespace Unit;
use Tests\TestCase;
use taskbee\Models\Plan;
use taskbee\Models\User;
use taskbee\Models\Subscription;
use taskbee\Facades\AuthorizationCode;
use Illuminate\Support\Facades\Mail;
<?php
namespace Tests\Feature;
use Tests\TestCase;
use taskbee\Models\User;
use taskbee\Models\Workspace;
use taskbee\Models\Invitation;
use taskbee\Mail\InvitationEmail;
use taskbee\Facades\InvitationCode;
<?php
namespace Tests\Feature;
use Carbon\Carbon;
use Tests\TestCase;
use taskbee\Models\Plan;
use taskbee\Billing\StripePlansGateway;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
<?php
namespace App\Utilities;
class ApiUsage
{
/**
* Record API usage for the authenticated user.
*
* @param array $response
<?php
namespace App\Listeners;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Registered;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class SaveIpAddress
<?php
namespace App\Listeners;
use App\Mail\UnknownLoginIp;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\Login;
use Illuminate\Support\Facades\Mail;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
<?php
namespace App\Utilities\Filters;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
class ActivityOnly implements Filter
{
/**