public function index()
 {
     return TypeModel::all()->toJson();
 }
示例#2
0
 /**
  * All types
  *
  * @return \Illuminate\Database\Eloquent\Collection
  */
 public function all()
 {
     return TypeModel::all();
 }
示例#3
0
 public function test_it_fetches_all_the_types_in_collection()
 {
     $types_collection = (new Type())->all();
     $this->assertInstanceOf('Illuminate\\Database\\Eloquent\\Collection', $types_collection);
     $this->assertEquals($types_collection->count(), TypeModel::all()->count());
 }