I have a question.
In a certain view of laravel I load certain data which through my controller I pass them with (Compact) and they are later loaded and I show them with my foreach. but I do not know if there is any way to pass that array to my vue component
In fact I could have implemented it with an APi that loads my list of products as an example, but I have a question about my Api. Well, it turns out to be something insecure and I do not know how I can do so that nobody else makes requests (I mean only the requests come from the same page) and that I can not see the list if I directly access my Apirest eg. www.example.com/listProducts
My controller only has it this way eg something short.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Producto;
class Ideacontroller extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function getProductos()
{
return Producto::orderBy('id','DESC')->get();
}
}