From 20017eb4f8f13f2e814a91484d2aeac788890c92 Mon Sep 17 00:00:00 2001 From: icalF <laser.survivor@gmail.com> Date: Wed, 18 May 2016 06:01:56 +0700 Subject: [PATCH] lol --- .DS_Store | Bin 0 -> 8196 bytes app/Http/Controllers/Auth/AuthController.php | 11 ++-- app/Pegawai.php | 11 ++++ app/User.php | 2 +- config/database.php | 14 +++++ public/.htaccess | 7 +++ public/index.php | 59 +------------------ resources/views/auth/register.blade.php | 6 +- 8 files changed, 43 insertions(+), 67 deletions(-) create mode 100644 .DS_Store create mode 100644 app/Pegawai.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..500257ec6080bcea5ec4c6d961264b89fb5aaa6a GIT binary patch literal 8196 zcmeHM!EO^V5Pfb#nh+2@p&s|h35h>gRRO72df`@fHzAa4vY}0&$9x7K#Ru>S`~`h8 zHpq5TA#p%dj3s-l-FZ9np1oO(1HhebCNF>!00VZh$0H7Vn%tMZ(+<Lwr?ifE;2djo zxWe?T-SM^yrhqA63YY?>fGO}VD8O&Fw80(UeSg<RQ@|AXFBOpAhk{*f8SK_u{psMK zB>-)Ym$h-uIzTZ+uw}4YZxzaC`s%?2s0$^A^KjlT#GSSbcI&N&!+AJdi0ndz;xsyO zg}TF)-r8sim;$>BNbNqv1;(u1FXH;WYwEVEc~@SjSM1MzXyXhxM1>VrXKmv3HS;>6 z*A-6$E^*D-GWB+^Gw&g4OfbV|OgWnqwayUV_8>Z*H>~;mH6t;n6rp*4iSmAohW-oY z-Vrk;<~cra*5%njxcm;;64zj!##CN0vad0hct=LF%vTu2z5^;ykxNAdD#<YQ7d~zf z@p(f3n(M~3Kuas^c=|$C*Z7DwLz7d29#QQLaVyQORUFkwQNkxd9dm7_#7wbd^o{m8 zvt90w>c}y{_Zab#S!Z#S+fBsn5o1)MFUQ%>-1e`Oi*Y03-m`C*5%&<Yy5WjvS}3a+ z)mKEVxiy&r!XWk?s>T(WFEp<OCMiO>e2=(zgzU2ou?<l<ds&+p@i6SqPxO^ts+`g& z$|1%a5#!I_RI$ukSj65B=*v7f=DBc}9lVLM??bYX)#mO>pDOQ3;%nc3zS7oAfqS69 zq0jL|>i?H_pa0(jCYGWpU<&-H0<JecAD<E(YU`cnNUdG4zh##uep_!9!a>V%S}n(E dfBj*|c|ljfl)-Mj<rOwN2v8YpFa`dq0=KrwK_>tJ literal 0 HcmV?d00001 diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index a100dd6..455e4e9 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -51,7 +51,7 @@ class AuthController extends Controller return Validator::make($data, [ 'name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', - 'password' => 'required|min:6|confirmed', + 'password' => 'required|min:6|confirmed' ]); } @@ -63,10 +63,11 @@ class AuthController extends Controller */ protected function create(array $data) { - return User::create([ - 'name' => $data['name'], + return (User::create([ + 'id' => $data['id'], + 'name' => \App\Pegawai::find($id)->nama, 'email' => $data['email'], - 'password' => bcrypt($data['password']), - ]); + 'password' => bcrypt($data['password']) + ])); } } diff --git a/app/Pegawai.php b/app/Pegawai.php new file mode 100644 index 0000000..22e93b5 --- /dev/null +++ b/app/Pegawai.php @@ -0,0 +1,11 @@ +<?php + +namespace App; + +use Illuminate\Database\Eloquent\Model; + +class Pegawai extends Model +{ + protected $connection = 'pplsql'; + protected $table = 'pegawai'; +} diff --git a/app/User.php b/app/User.php index a2da2f8..7c82d45 100644 --- a/app/User.php +++ b/app/User.php @@ -12,7 +12,7 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'name', 'email', 'password', + 'id', 'name', 'email', 'password', ]; /** diff --git a/config/database.php b/config/database.php index 8451a62..16ebed7 100644 --- a/config/database.php +++ b/config/database.php @@ -66,6 +66,20 @@ return [ 'engine' => null, ], + 'pplsql' => [ + 'driver' => 'mysql', + 'host' => env('DB_HOST_PPL', 'localhost'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE_PPL', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD_PPL', ''), + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + 'engine' => null, + ], + 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', 'localhost'), diff --git a/public/.htaccess b/public/.htaccess index 1d67776..1ece793 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -1 +1,8 @@ DirectoryIndex index.php + +Options +FollowSymLinks +RewriteEngine On + +RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^ index.php [L] \ No newline at end of file diff --git a/public/index.php b/public/index.php index c582053..fb92a28 100644 --- a/public/index.php +++ b/public/index.php @@ -1,58 +1 @@ -<?php - -/** - * Laravel - A PHP Framework For Web Artisans - * - * @package Laravel - * @author Taylor Otwell <taylorotwell@gmail.com> - */ - -/* -|-------------------------------------------------------------------------- -| Register The Auto Loader -|-------------------------------------------------------------------------- -| -| Composer provides a convenient, automatically generated class loader for -| our application. We just need to utilize it! We'll simply require it -| into the script here so that we don't have to worry about manual -| loading any of our classes later on. It feels nice to relax. -| -*/ - -require __DIR__.'/../bootstrap/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Turn On The Lights -|-------------------------------------------------------------------------- -| -| We need to illuminate PHP development, so let us turn on the lights. -| This bootstraps the framework and gets it ready for use, then it -| will load up this application so that we can run it and send -| the responses back to the browser and delight our users. -| -*/ - -$app = require_once __DIR__.'/../bootstrap/app.php'; - -/* -|-------------------------------------------------------------------------- -| Run The Application -|-------------------------------------------------------------------------- -| -| Once we have the application, we can handle the incoming request -| through the kernel, and send the associated response back to -| the client's browser allowing them to enjoy the creative -| and wonderful application we have prepared for them. -| -*/ - -$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); - -$response = $kernel->handle( - $request = Illuminate\Http\Request::capture() -); - -$response->send(); - -$kernel->terminate($request, $response); +<?php php_ini_loaded_file(); ?> \ No newline at end of file diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 24f0d99..8b0a49f 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -29,10 +29,10 @@ <div class="list-group list-group-sm"> <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}"> - <input type="text" placeholder="Nama" class="form-control" name="name" required value="{{ old('name') }}"> - @if ($errors->has('name')) + <input type="text" placeholder="NIP" class="form-control" name="id" required value="{{ old('id') }}"> + @if ($errors->has('id')) <span class="help-block"> - <strong>{{ $errors->first('name') }}</strong> + <strong>{{ $errors->first('id') }}</strong> </span> @endif </div> -- GitLab