Helper Flashcards

1
Q

의존성 해결을 위해서 사용하는 헬퍼는?

A

app()

ex)
$api = app(‘HelpSpot\API’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Carbon::now() 와 동일한 헬퍼는?

A

now()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

객체가 null 이면 에러를 발생시키지 않고

null을 리턴하는 헬퍼

A

optional()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

값을 암호화하는 헬퍼

Crypt 퍼사드 대신에 쓸 수 있음.

A

encrypt()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

authenticator 인스턴스 반환하는 거

A

auth()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

사용자가 로그인 했는지 확인하는 거

A

auth()->check()

로그인 하면 true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

로그인한 사용자 가져오는 거

A

auth()->user()

(로그인 안되면 null 반환)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

현재 사용자 id 가져오는 거

A

auth()->id()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

문자열에서 문자를 포함하는지 확인하는 거

A

Str::contains(문자열, 문자);

있다면 true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

HTTP 예외를 던지는 헬퍼

A

abort()

ex)
abort(403, ‘Unauthorized.’, $headers)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

job을 전달하는 거

A

dispatch()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

이벤트 일으키는 거

A

event()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

배열을 컬렉션으로 바꾸는 거

A

collect()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly