Skip to content

Instantly share code, notes, and snippets.

View yugo412's full-sized avatar
🏠
Working from ~/

Yugo yugo412

🏠
Working from ~/
View GitHub Profile
<!-- Start Pointer Widget -->
<script src="https://login.pointer.co.id/inc/widget/register.js"></script>
<div class="pointer-widget-body"></div>
<script>
PointerEngine.Widget({
memberCode: 'berbisnistiket.com',
useBootstrap: true,
widgetTitle: 'Registration Form',
widgetButtonText: 'Free trial!'
});
@yugo412
yugo412 / Chained.php
Last active November 3, 2023 06:34
Fungsi berantai (chained method/function) pada PHP.
<?php
/**
* Simple chained method in PHP
*
* @link http://laravel.web.id/tips-trik/membuat-fungsi-berantai-chained-methodfunction-di-php/
* @copyright 2016
*/
class User {
@yugo412
yugo412 / LoginController.php
Last active January 28, 2024 15:52
Redirect to custom URL after logout on Laravel
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller
@yugo412
yugo412 / 000-laravel.conf
Created October 17, 2016 14:28
Docker-compose for Laravel 4.2
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
@yugo412
yugo412 / search.php
Created December 3, 2016 03:11
Pencarian kata di Glosarium API
<?php
if (function_exists('curl_init')) {
die('cURL library is not installed.');
}
$curl = curl_init('http://api.glosarium.web.id?');
curl_setop($curl, CURLOPT_RETURNTRANSFER, true);
<?php
// app/Providers/RouteServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
Field Type Collation Null Key Default Extra Privileges Comment
-------------- ---------------- --------------- ------ ------ ------- -------------- ------------------------------- ---------
id int(10) unsigned (NULL) NO PRI (NULL) auto_increment select,insert,update,references
name varchar(255) utf8_unicode_ci NO MUL (NULL) select,insert,update,references
email varchar(255) utf8_unicode_ci NO UNI (NULL) select,insert,update,references
birthplace varchar(50) utf8_unicode_ci YES (NULL) select,insert,update,references
birthdate date (NULL) YES (NULL) select,insert,update,references
gender enum('m','f') utf8_unicode_ci NO m
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Change Password</div>
<div class="panel-body">
@if (session()->has('success'))
Route::group(['middleware' => 'auth'], function () {
Route::get('password', 'PasswordController@change')->name('password.change');
Route::put('password', 'PasswordController@update')->name('password.update');
});