I'm trying to merge eloquent result and array because I need to add all possible filters that user can use for this model. If anyone have any other idea how to make it I really would be very thankful. Here is an example code:
<?php
class School extends Eloquent {
protected $table = 'schools';
public function listSchoolsEndUser()
{
$schools_data = new School;
$schools_data = $schools_data->paginate(12);
$filters = array(
'filters' => array(
'name' => 'Neshtoto'
)
);
$schools_data = (object) array_merge(get_object_vars($schools_data), $filters);
echo '<pre>';
print_r( $schools_data );
exit;
return $schools_data;
}
And the result is very interesting:
stdClass Object
(
[filters] => Array
(
[name] => Neshtoto
)
)