It appear you can write Factories in Laravel.
According to doumentation: https://laravel.com/docs/5.3/database-testing#writing-factories
It appear Factories for the model/database related.
Is it possible to write Factories for non model related?
For example of two classes:
class Car {
public function drive() { }
}
Class Bike {
public function ride() { }
}
Rather than using (new Car)->drive() I would like to use Transport Factory to class the class.
Transport::build('car')->drive();I wonder if Laravel support such thing. - I'll-Be-Back(new Car)->drive()? - Rwd