php doesn't work like that. you can store php code on the db and use eval() to run it but that's a very bad practice.
what you can do is store the "variables" used in the extra syntax
// take variables from db
$source = // value from db
$x = // value from db
$y = // value from db
$limit= // value from db
$color= // value from db
$image = $manager->make($source)->fit($x, $y, null)->limitColors($limit, $color)->invert();
echo $image->response('jpg', 85);
that' simple programming stuff
The best approach would be to serialize your object.
Serialize your image object, put it into the database and if you want to use it again, get the string from database and deserialize it.
see: http://php.net/manual/en/language.oop5.serialization.php
i don't see why you have to do that? serialize and unserialize takes too much overhead and if you don't base64 encode it you won't unserialize. serializing and storing on db is a really really bad practice.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community