This file contains 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
<div class="col-sm-6 mb-3"> | |
<label class="form-label" for="npwp">NPWP</label> | |
<div class="input-group"> | |
<span class="input-group-text"><i class="ti ti-id"></i></span> | |
<input type="text" name="npwp" id="npwp" class="form-control" placeholder="NPWP" | |
value="{{$karyawan_detail->npwp }}" required /> | |
</div> | |
</div> | |
<div class="col-sm-6 mb-3"> | |
<label class="form-label" for="npwp_file">Foto NPWP</label> |
This file contains 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
input = 'akas' | |
temp = '' | |
for i in input: | |
temp = i + temp | |
if input == temp: | |
print('yes') | |
else: | |
print('no') |
This file contains 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 | |
public function check(Request $request){ | |
$input = $request->all(); | |
$this->validate($request, [ | |
'email' => 'required', | |
'password' => 'required', | |
],[ | |
'email.required' => 'Email is required', | |
'password.required' => 'Password is required', |
This file contains 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
function delayInput(callback, ms) { | |
var timer = 0; | |
return function() { | |
var context = this, args = arguments; | |
clearTimeout(timer); | |
timer = setTimeout(function () { | |
callback.apply(context, args); | |
}, ms || 0); | |
}; | |
} |
This file contains 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
- nambah field sessionid di table user | |
$ php artisan make:migration add_session_id_to_users_table --table=users | |
- lakukan migration | |
$ php artisan migrate | |
- method sendLoginResponse() ini akan mereplace method yang ada di trait “AuthenticatesUsers” | |
- tambahkan library berikut | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Session; |
This file contains 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 | |
public function index($slug) | |
{ | |
$parent = Category::where('slug', $slug)->first(); | |
$child = Category::where('parent_id',$parent->id)->get(); | |
$category_id = $parent->id; | |
$child_array_id = []; | |
foreach ($child as $key => $value) { | |
$child_array_id[$key] = $value->id; | |
} |
This file contains 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
text = 'this is text' | |
text.substring(0, 7) + '...' | |
// output | |
// this is... |
This file contains 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 App\Traits\Upload; | |
// in Class | |
use Upload; | |
$template = new Template; | |
$template->name = $request->name; | |
// is create |
This file contains 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
//masuk mysql cli | |
SHOW VARIABLES LIKE 'validate_password%'; | |
SET GLOBAL validate_password.policy=LOW; |
NewerOlder