Skip to content

Instantly share code, notes, and snippets.

View andri-sudarmawijaya's full-sized avatar

Andri Sudarmawijaya andri-sudarmawijaya

View GitHub Profile
<?php
$sekolah = New stdClass Object
(
[nama] => SMP N 4 CIBINONG
[sekolah_id] => E0E61E14-2CF5-E011-80BF-795521474989
[npsn] => 20254243
[jumlah_kirim] => 5
[ptk] => 49
[pegawai] => 6
CREATE TABLE ref.negara
(
negara_id character(2) NOT NULL,
nama character varying(45) NOT NULL,
luar_negeri numeric(1,0) NOT NULL,
create_date timestamp(0) without time zone NOT NULL,
last_update timestamp(0) without time zone NOT NULL,
expired_date timestamp(0) without time zone,
last_sync timestamp(0) without time zone NOT NULL,
CONSTRAINT negara_pkey PRIMARY KEY (negara_id)
@andri-sudarmawijaya
andri-sudarmawijaya / AdminUserSeeder
Created January 7, 2018 14:03
How to reset laravel admin password using seeder
- edit file .\database\seeds\DatabaseSeeder.php
- add $this->call(AdminUserSeeder::class);
```
public function run()
{
$this->call(AdminUserSeeder::class);
//$this->call(UsersTableSeeder::class);
}
```
edit file .\database\seeds\AdminUserSeeder.php
@andri-sudarmawijaya
andri-sudarmawijaya / 1README.md
Created January 3, 2018 11:50 — forked from joseluisq/1README.md
How add a custom field to Laravel 5.4 default login. LoginController.php

How add a custom field to Laravel 5.4 default login controller.

In this php example (app/Http/Controllers/Auth/LoginController.php) my model is called Client and the custom field for login validation is status. (Client->status)

Add in your resources/lang/en/auth.php file :

    'failed_status' => 'Your account is inactive yet. Please confirm your e-mail address.',
public function up()
{
Schema::table('todolists', function(Blueprint $table)
{
$table->integer('category_id')->unsigned()->after('id');
$table->foreign('category_id')->references('id')->on('categories');
});
}
@andri-sudarmawijaya
andri-sudarmawijaya / create_something_down_table.php
Created December 9, 2017 07:11
Drop foreign key when php artisan down
public function down()
{
Schema::table('todolists', function(Blueprint $table)
{
$table->dropForeign('todolists_category_id_foreign');
$table->dropColumn('category_id');
});
}