I am sending a URL to the mail of a user who should receive it like this:
Where 23 is the id of a record in a table, which for practical purposes is not desired at this time, so I convert 23 with sha1 () a string .. so that the URL finally sent is approximately .
http://dominio/registro/fjhjsdfsd9fsdfn4kw8944mfg9rtgmerer
So far so good, the issue is that already back in the system to validate that url I need to contrast it with the original ID (23).
As this is a value that comes from an external environment I would not like to pass the evaluation to eloquent as a MySQL RAW query type:
SELECT * FROM tabla WHERE sha1(id) = "fjhjsdfsd9fsdfn4kw8944mfg9rtgmerer"
But I can not make something like that work in eloquent:
$model = ClaseX::where(sha1("id"),"fjhjsdfs...gmerer")->first();
Obviously sha1 ("id") apparently calculates the value but for the string "id" and not for the id field of the table.
Any ideas to validate the ID that is sent to the mail without having to show it explicitly and not pass a RAW query to Eloquent ???