Maybe I'm doing something wrong, but I'm coming from the PDO world, and I'm used to passing arguments to the class where the string is instantiated, and then this constructor will dynamically set the field for me. How is this achieved with Eloquent?
// Old way $dm = new DataModel('value');
DataModel.php
class DataModel() { function __construct($value = null) { $this->value = $value; } }
I read that Eloquent provides you with the ::create() method, but I do not want to save the record at this point.
The problem here is that Eloquent has its own constructor, and I'm not sure if my model will completely override this constructor.
source share