Skip to content

Instantly share code, notes, and snippets.

View ecojuntak's full-sized avatar
🌏

Eko Simanjuntak ecojuntak

🌏
View GitHub Profile
@ecojuntak
ecojuntak / README.md
Last active August 11, 2019 11:53
Update README.md

Geometry

Problem Description

As a fan of geometry, I want to model a line based on points consisting of (x, y) co-ordinates using the cartesian system, so that I can calculate its length.

Requirements

.gradle
.idea
out/
*.class
*.log
*.jar
build/
!gradle-wrapper.jar
.DS_Store
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BookController extends Controller
{
/**
* Display a listing of the resource.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class BookController extends Controller
{
//
}
<?php
use Illuminate\Http\Request;
Route::get('/', function() {
return "Respon ini diterima dari path / dengan metode GET";
});
Route::get('/books', function(Request $request) {
return "Router ini nantinya akan digunakan untuk mengambil semua data buku. Closure method pada router ini juga menerima satu parameter yaitu $request yang digunakan untuk menampung query paramater";
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
....
<?php
Route::get('/', function() {
return "Respon ini diterima dari path / dengan metode GET";
});
Route::get('/books', function() {
return "Router ini nantinya akan digunakan untuk mengambil semua data buku";
});
<?php
....
class CreateBooksTable extends Migration
{
public function up()
{
Schema::create('books', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title');
$table->string('author');
create table 'books' (
'id' int unsigned not null auto_increment primary key,
'title' varchar(255) not null,
'author' varchar(255) not null,
'publication' varchar(255) not null,
'year' int unsigned not null,
'created_at' timestamp null,
'updated_at' timestamp null
}
<?php
....
class CreateBooksTable extends Migration
{
public function up()
{
Schema::create('books', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title');