Skip to content

Instantly share code, notes, and snippets.

View stephenjude's full-sized avatar
😇
PHP Developer

Stephen Jude stephenjude

😇
PHP Developer
View GitHub Profile
<?php
class ProductTest extends TestCase
{
/**
* /products [GET]
*/
public function testShouldReturnAllProducts(){
$this->get("products", []);
APP_ENV=local
APP_DEBUG=true
APP_KEY=afdfdhdfdueuekfhhfueyeyjcfh
APP_TIMEZONE=UTC
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=product_db
DB_USERNAME=root
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
/**
* Run the migrations.
<?php
$factory->define(App\Product::class, function (Faker\Generator $faker) {
return [
'product_name' => $faker->word,
'product_description' => $faker->text,
];
});
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
/**
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
<?php
$app->get('/', function () use ($app) {
return $app->version();
});
//product routes
$app->get('products', 'ProductsController@index');
$app->get('products/{id}', 'ProductsController@show');
$app->put('products/{id}', 'ProductsController@update');
<?php
namespace App\Http\Controllers;
use App\Product;
use Illuminate\Http\Request;
use League\Fractal;
use League\Fractal\Manager;
use League\Fractal\Resource\Item;
use League\Fractal\Resource\Collection;
<?php
namespace App\Transformers;
use App\Product;
use League\Fractal;
class ProductTransformer extends Fractal\TransformerAbstract
{
public function transform(Product $product)
{
@stephenjude
stephenjude / namecheap SSL.md
Created October 7, 2018 20:56 — forked from Shourai/namecheap SSL.md
Letsencrypt SSL certificate with namecheap hosting

source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/

The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”

Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.

First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.