Add some helper functions
This commit is contained in:
parent
44fd2207fe
commit
0414760cf0
@ -239,6 +239,16 @@ class Blocks extends BlockKit
|
|||||||
return $this->section(['text'=>$text]);
|
return $this->section(['text'=>$text]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a spacer line
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function addSpacer(): self
|
||||||
|
{
|
||||||
|
return $this->section(['text'=>Text::item(' ')]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A context block
|
* A context block
|
||||||
*
|
*
|
||||||
|
@ -42,6 +42,11 @@ class Channel extends Model
|
|||||||
return Arr::get($this->attributes,'name') ?: $this->channel_id;
|
return Arr::get($this->attributes,'name') ?: $this->channel_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSlackUrlAttribute(): string
|
||||||
|
{
|
||||||
|
return sprintf('<#%s>',$this->channel_id);
|
||||||
|
}
|
||||||
|
|
||||||
/* METHODS */
|
/* METHODS */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,6 +24,16 @@ class User extends Model
|
|||||||
|
|
||||||
/* ATTRIBUTES */
|
/* ATTRIBUTES */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this user an admin
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getIsAdminAttribute(): bool
|
||||||
|
{
|
||||||
|
return $this->admin;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the user in slack response format
|
* Return the user in slack response format
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user