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
| <?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 | |
| 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 | |
| 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 MemberController extends Controller | |
| { | |
| public function index() | |
| { |
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 MemberController extends Controller | |
| { | |
| // | |
| } |
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 | |
| // set timeout | |
| Http::timeout($second)->get('...'); | |
| // retry | |
| Http::retry($times, $wait)->post('...'); | |
| // throw | |
| Http::post('...')->throw()->json(); |
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 | |
| use Illuminate\Support\Facades\Http; | |
| // kirim request | |
| Http::get('...'); | |
| Http::post('...'); | |
| Http::put('...'); | |
| Http::delete('...'); |
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 | |
| $response->body() : string; | |
| $response->json() : array|mixed; | |
| $response->status() : int; | |
| $response->ok() : bool; | |
| $response->successful() : bool; | |
| $response->failed() : bool; | |
| $response->serverError() : bool; | |
| $response->clientError() : bool; |
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 express = require('express') | |
| const app = express() | |
| app.get('/', function (req, res) { | |
| res.send('Hello World') | |
| }) | |
| app.listen(3000) |