You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/app/Http/Controllers/Api/ApiV1Controller.php

26 lines
534 B
PHTML

2 years ago
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Models\Cat;
use App\Models\Product;
use Illuminate\Http\Request;
use Xmen\StarterKit\Models\Post;
class ApiV1Controller extends Controller
{
//
public function index(){
$posts = Post::limit(10)->get();
$products = Product::limit(10)->get();
$categories = Cat::get();
return [
'posts' => $posts,
'products' => $products,
'categories' => $categories
];
}
}