Decoded Output
Download<?php
namespace App\Repositories;
use App\Models\Interaction;
use App\Models\User;
use App\Repositories\Traits\ByCurrentUser;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
class InteractionRepository extends Repository
{
use ByCurrentUser;
/** @return Collection|array<Interaction> */
public function getUserFavorites(User $user): Collection
{
return $this->model
->newQuery()
->where([
'user_id' => $user->id,
'liked' => true,
])
->with('song')
->pluck('song');
}
/** @return array<Interaction> */
public function getRecentlyPlayed(User $user, ?int $count = null): array
{
return $this->model
->newQuery()
->where('user_id', $user->id)
->where('play_count', '>', 0)
->latest('last_played_at')
->when($count, static fn (Builder $query, int $count) => $query->take($count))
->pluck('song_id')
->all();
}
}
?>
Did this file decode correctly?
How would you describe this file?
Thank you for your feedback! This will help us detect malicious PHP files more accurately in the future.
Function Calls
None
Variables
None
Stats
| MD5 | fdfbfa300129e565 |
|---|---|
| Eval Count | 0 |
| Decode Time | 112 ms |
Original Code
<?php
namespace App\Repositories;
use App\Models\Interaction;
use App\Models\User;
use App\Repositories\Traits\ByCurrentUser;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
class InteractionRepository extends Repository
{
use ByCurrentUser;
/** @return Collection|array<Interaction> */
public function getUserFavorites(User $user): Collection
{
return $this->model
->newQuery()
->where([
'user_id' => $user->id,
'liked' => true,
])
->with('song')
->pluck('song');
}
/** @return array<Interaction> */
public function getRecentlyPlayed(User $user, ?int $count = null): array
{
return $this->model
->newQuery()
->where('user_id', $user->id)
->where('play_count', '>', 0)
->latest('last_played_at')
->when($count, static fn (Builder $query, int $count) => $query->take($count))
->pluck('song_id')
->all();
}
}