I'm trying to get a public version of my website going. I can connect to the page. routing is working.
The app is working with an API, and that is giving errors:
ErrorException in Transformer.php line 16:
Runtime Notice: Static function App\Transformers\Transformer::transform() should not be abstract
The transformer get's called like this:
FeedTransformer::transformCollection( $userFeed )
and this is build up like following:
FeedTransformer.php
<?php
namespace App\Transformers;
use App\Story;
use App\Post;
use Illuminate\Database\Eloquent\Model;
class FeedTransformer extends Transformer {
public static function transform(Model $item, $args = [ ]) {
$return = array();
if ($item instanceof Story) {
$return = StoryTransformer::transform( $item, [ 'level' => 'story' ] );
}
if ($item instanceof Post) {
$return = PostTransformer::transform( $item, [ 'level' => 'posts' ] );
}
return $return;
}
}
and the Transformer.php
<?php
namespace App\Transformers;
use Illuminate\Database\Eloquent\Model;
abstract class Transformer {
public static function transformCollection($items, $args = []) {
foreach ($items as $item) {
array_push( $var, static::transform( $item , $args) );
}
return $var;
}
public static abstract function transform(Model $item,$args = []);
}
So I'm not fully sure why this is causing an error on my server while not on my localhost development
Anyone got a clue why this error is being thrown?