Skip to content

Instantly share code, notes, and snippets.

@Firesphere
Created August 19, 2019 21:42
Show Gist options
  • Save Firesphere/d776eafbe72acbef8d22ae8f64ef092c to your computer and use it in GitHub Desktop.
Save Firesphere/d776eafbe72acbef8d22ae8f64ef092c to your computer and use it in GitHub Desktop.
Adding last login recording
<?php
namespace App\Extensions;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Security\LoginAttempt;
/**
*
* @property LoginAttempt|LoginAttemptExtension $owner
*/
class LoginAttemptExtension extends DataExtension
{
private static $summary_fields = [
'Email',
'Created',
'Status'
];
}
<?php
namespace App\Extensions;
use SilverStripe\Security\LoginAttempt;
use SilverStripe\Security\Member;
/**
*/
class MemberExtension extends DataExtension
{
private static $has_many = [
'LoginAttempts' => LoginAttempt::class,
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment