Skip to content

Instantly share code, notes, and snippets.

View ajuchacko's full-sized avatar
🎯
Focusing

Aju Chacko ajuchacko

🎯
Focusing
View GitHub Profile
<?php
namespace App;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\ServerRequest;
use GuzzleHttp\Psr7\UploadedFile;
use GuzzleHttp\Psr7\Uri;
use GuzzleHttp\Psr7\Utils;
Class User {
public function listAll() {
// This method is used on many classes.eg: Member class
}
}
class Member {
private $user;
@ajuchacko
ajuchacko / StringtoArray.php
Last active November 3, 2018 13:09
Create described structure from the given string (name of software can't be repeated even though years/versions can)
<?php
// Given String:
$string = "word_2007, word_2010, word_2007, sublime, phpstorm_2010, phpstorm_2010,
netbeans, netbeans, sublime, word_2007, phpstorm_2010, atom";
// Desired Structure:
// sample : ['word' => [2007, 2010], 'sublime', 'netbeans', 'phpstorm' => [2010], 'atom'];
/* 1. Solution
<?php
namespace Tests\Browser;
use Tests\DuskTestCase;
use Laravel\Dusk\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class ExampleTest extends DuskTestCase
{
<form action="<?= url('process') ?>" method="POST">
<script
src="https://checkout.razorpay.com/v1/checkout.js"
data-key="<?= getenv('RAZORPAY_KEY') ?>"
data-amount="<?= 5000 ?>"
data-currency="INR"
data-name="<?= 'Vendor Inc' ?>"
data-prefill.method="netbanking"
data-description="<?php echo 'description of purchase' ?>"
data-prefill.name="<?php echo 'Aju chacko' ?>"