Skip to content

Instantly share code, notes, and snippets.

View xeebeast's full-sized avatar

Zeeshan Tariq xeebeast

View GitHub Profile
@xeebeast
xeebeast / GcsUpload.php
Last active December 17, 2018 11:31
Upload file to Google Storage
Storage::disk('gcs')->put("Name.pdf", $this->fileContent, 'public');
$pdfUrl = Storage::disk('gcs')->url("Name.pdf");
@xeebeast
xeebeast / GoogleCloudStorageServiceProvider.php
Created December 17, 2018 11:15
Google Cloud Storage Service Provier File For Lumen Projects
<?php
namespace App\Providers;
use Google\Cloud\Storage\StorageClient;
use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Support\ServiceProvider;
use League\Flysystem\Filesystem;
use App\Adapters\GoogleStorageAdapter;
class GoogleCloudStorageServiceProvider extends ServiceProvider
{
/**
@xeebeast
xeebeast / GoogleStorageAdapter.php
Created December 17, 2018 11:12
Google Storage Adapter File to add GCS service to Lumen Project
<?php
namespace App\Adapters;
use Google\Cloud\Core\Exception\NotFoundException;
use Google\Cloud\Storage\Acl;
use Google\Cloud\Storage\Bucket;
use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Storage\StorageObject;
use GuzzleHttp\Psr7\StreamWrapper;
use League\Flysystem\Adapter\AbstractAdapter;
use League\Flysystem\AdapterInterface;
@xeebeast
xeebeast / filesystems.php
Created December 17, 2018 11:07
filesystems.php file for Lumen Projects
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
@xeebeast
xeebeast / Generic-Ajax
Created March 1, 2017 11:16
Do not repeat your code for every AJAX call
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<title>Generic Ajax</title>
<input type="text" class="text">
<input type="button" class="btn-primary check" value="test">
<h3> Ajax Response </h3><br>
<b id="res"></b>
<script type="text/javascript">