Skip to content

Instantly share code, notes, and snippets.

😎
Building for the next billion users...

Stephen Jude stephenjude

😎
Building for the next billion users...
Block or report user

Report or block stephenjude

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stephenjude
stephenjude / namecheap SSL.md
Created Oct 7, 2018 — forked from Shourai/namecheap SSL.md
Letsencrypt SSL certificate with namecheap hosting
View namecheap SSL.md

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.

View ProductTransformer.php
<?php
namespace App\Transformers;
use App\Product;
use League\Fractal;
class ProductTransformer extends Fractal\TransformerAbstract
{
public function transform(Product $product)
{
View ProductsController.php
<?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;
View web.php
<?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');
View DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
View Product.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
/**
View ModelFactory.php
<?php
$factory->define(App\Product::class, function (Faker\Generator $faker) {
return [
'product_name' => $faker->word,
'product_description' => $faker->text,
];
});
View create_products_table.php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
/**
* Run the migrations.
View .env
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
View ProductTest.php
<?php
class ProductTest extends TestCase
{
/**
* /products [GET]
*/
public function testShouldReturnAllProducts(){
$this->get("products", []);
You can’t perform that action at this time.