Skip to content

Instantly share code, notes, and snippets.

View stephenjude's full-sized avatar
😎
Software Developer

Stephen Jude stephenjude

😎
Software Developer
View GitHub Profile
<?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
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateProductsTable extends Migration
{
/**
* Run the migrations.
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
/**
<?php
$factory->define(App\Product::class, function (Faker\Generator $faker) {
return [
'product_name' => $faker->word,
'product_description' => $faker->text,
];
});
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