1
Is it possible to create alias for the columns name of a table in using the Laravel Model? Example: I have a table questao
with the columns:
id
questao
disciplinas_id
serie_id
professor_id
It would be simpler if I could treat the columns by other names within the application. Calling professor_id
of prof
, for example. I did some research but found nothing to help me. Does anyone know if Eloquent allows it? If so, how to do it?
From the examples I saw when searching, it is possible to do this using this solution - https://github.com/jarektkaczyk/eloquence/wiki/Mappable
– Ademílson F. Tonato