Skip to content

Instantly share code, notes, and snippets.

Kenny Ray kennyray

Block or report user

Report or block kennyray

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b35f4c6640be9539c5d16581de7714e0
class CountdownTimer {
constructor(minutesLabel = null, secondsLabel = null) {
this.minutesLabel = minutesLabel;
this.secondsLabel = secondsLabel;
this.totalSeconds = (this.minutesLabel.textContent / 60) + this.secondsLabel.textContent;
this.timer = null;
}
@kennyray
kennyray / Laravel Eloquent only()
Last active Oct 12, 2018
Laravel Eloquent only()
View Laravel Eloquent only()
$fullModel = Model::find(1) // Get model with id 1
$idArray = $fullModel->only('id') // array containing id
// this does not work. You'll get back an empty collection
// It is trying to pull the id column off the collection object,
// not the models it contains
$models = Model::all()
$ids = $models->only('id')
You can’t perform that action at this time.