This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace {{ namespace }}; | |
use {{ rootNamespace }}Http\Controllers\Controller; | |
use Illuminate\Http\Request; | |
class {{ class }} extends Controller | |
{ | |
public function getRequest() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class UserController extends Controller | |
{ | |
public function getRequest() { | |
// kode kamu disini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// kasus 1 | |
$kata = "aku adalah anak gembala "; | |
$hasil = str_replace('aku', 'kamu', trim(strtoupper($kata))); | |
// kasus 2 | |
$hasil = strtoupper($kata); | |
$hasil = trim($hasil); | |
$hasil = str_replace('aku', 'kamu, $hasil); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$kata = "aku adalah anak gembala "; | |
$hasil = Str::of($kata)->upper()->trim()->replace('aku', 'kamu'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AdminBro = require('admin-bro') | |
const AdminBroExpress = require('admin-bro-expressjs') | |
const AdminBroMongoose = require('admin-bro-mongoose') | |
const express = require('express') | |
const app = express() | |
AdminBro.registerAdapter(AdminBroMongoose) | |
const mongoose = require('mongoose') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const User = mongoose.model('User', new mongoose.Schema({ | |
username: String, | |
password: String, | |
about: String, | |
joinAt: Date, | |
points: Number | |
})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const KomponenFungsi = () => { | |
return <h1>Halo, Ini dibuat dengan Functional Component</h1>; | |
}; | |
/// atau 👇 | |
function KomponenFungsiBentukLain() { | |
return <h1>Halo, ini komponen fungsi</h1>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
class ClassComponent extends Component { | |
render() { | |
return <h1>JSX di dalam fungsi render component</h1>; | |
} | |
} | |
/// atau 👇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pemanggilan | |
<Card name="Agus"/> | |
const Card = (props) => { | |
return <h1>Hai, {props.name}</h1>; | |
}; | |
// atau bisa di pecah langsung menggunakan object desctructure | |
// jadi kita bisa langsung memanggil 'name' tanpa variable props |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Card extends React.Component { | |
render() { | |
const { name } = this.props; | |
return <h1>Hello, { name }</h1>; | |
} | |
// atau 👇 | |
render() { | |
return <h1>Hello, { this.props.name }</h1>; |