mirror of https://github.com/4xmen/xshop.git
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.
26 lines
534 B
PHTML
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
|
||
|
];
|
||
|
}
|
||
|
}
|