Skip to content

Instantly share code, notes, and snippets.

View joesoeph's full-sized avatar

Yusuf Fazeri joesoeph

View GitHub Profile
db.products.insertMany([
{
_id: 1,
name: "Indomie Ayam Bawang",
price: 3000,
stock: 30,
unit: "pcs",
description: "Harga jual perbungkus",
categories: ["makanan", "mie"],
suppliers: [
@code-poel
code-poel / laravel_table_schema.php
Last active November 13, 2023 13:29
Get schema metadata on Laravel tables or columns...
<?php
// https://stackoverflow.com/questions/18562684/how-to-get-database-field-type-in-laravel/18563159#18563159
/* @var $schema \Doctrine\DBAL\Schema\AbstractSchemaManager */
$schema = DB::getDoctrineSchemaManager();
$columns = $schema->listTableColumns('cities');
dd($columns);
/*
@phoenixg
phoenixg / header_http_status_codes.php
Created April 6, 2013 14:02
PHP header() for sending HTTP status codes
<?php
/*
参考自:
http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function
http://snipplr.com/view/68099/
*/
function HTTPStatus($num) {
$http = array(