This is a great refactor! It's a good practice to break out code into its own class, especially when it's related to a particular resource.
It's also not wrong to resolve off the app container from a static class method. In fact, this is a common pattern in many frameworks.
You could also consider using dependency injection instead of resolving off the app container. This would allow you to inject the database instance into the Note class, rather than resolving it each time.
class Note
{
private $db;
public function __construct(Database $db)
{
$this->db = $db;
}
public static function get($id)
{
return $this->db->query('select * from notes where id = :id', [
'id' => $id
])->findOrFail();
}
}