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
//Role 지정 | |
$user->assignRole('관리자') | |
//$user의 모든 roles 리턴 | |
$user->roles()->pluck('name'); | |
//Role 삭제 | |
$user->removeRole('writer'); |
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
/** | |
* 주민번호 생성기 | |
* 사용예) jumin() | |
* jumin({year:1990, month:3, day: 12, loop: 10}); //1990년 3월 12일생 10개 주민번호 생성. | |
* 확인예) jumin.verify(확인할 주민번호) 확인할 주민번호는 - 있어도 없어도 무관. 13자리만 맞추면 됨. | |
* @param {object} options 옵션 | |
* year: 년도, 빈 값으면 랜덤 | |
* month: 월, 빈 값이면 랜덤 | |
* day: 일, 빈 값이면 랜덤 | |
* loop: 생성개수, 빈 값이면 1개 생성. |
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
trait UuidTrait | |
{ | |
/** | |
* Defines the UUID field for the model. | |
* @return string | |
*/ | |
protected static function uuidField() | |
{ | |
return 'uuid'; | |
} |
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
pmset -g | |
log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h | |
//mdworker disable | |
sudo mdutil -a -i off | |
//mdwork enable | |
sudo mdutil -a -i on |
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 | |
echo ((true&&true)?'true<br>':'false<br>'); | |
echo ((true&&false)?'true<br>':'false<br>'); | |
echo ((false&&true)?'true<br>':'false<br>'); | |
echo ((false&&false)?'true<br>':'false<br>'); | |
/* | |
true | |
false | |
false | |
false |
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
/* debugbar.css */ | |
body div.phpdebugbar { | |
font-size: 10px; | |
} | |
body div.phpdebugbar-header > div > * { | |
font-size: 10px; | |
padding: 2px 5px; | |
} |
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
/* | |
[Illuminate\Database\QueryException] | |
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) | |
[PDOException] | |
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes | |
*/ | |
use Illuminate\Support\Facades\Schema; |
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
/** | |
* | |
* 같은 값이 있는 열을 병합함 | |
* | |
* 사용법 : $('#테이블 ID').rowspan(0); | |
* | |
*/ | |
$.fn.rowspan = function(colIdx, isStats) { | |
return this.each(function(){ | |
var that; |
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
[Version] | |
major = 1 | |
minor = 1 | |
[Common] | |
black_char = "\\/" | |
black_name = "@tmp", "@eaDir", ".SynologyWorkingDirectory", "#recycle", "desktop.ini", ".ds_store", "Icon\r", "thumbs.db", "$Recycle.Bin", "@sharebin", "System Volume Information", "Program Files", "Program Files (x86)", "ProgramData", "#snapshot", "vendor", "node_modules", "framework", "debugbar" | |
max_length = 255 | |
max_path = 768 |
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
public function setItemsAttribute(array $items): void | |
{ | |
static::saved(function (self $model) use ($items) { | |
$this->items()->sync($items); | |
}); | |
} |