lundi 6 avril 2020

how to prepare api using laravel and vue.js

good day; I am new in vue.js and I want to build API in my project using vue.js and laravel I have some question and answer because I got confused I have services controller that return all service as below:-

class ServicesController extends Controller
{
    public function Services()
    {
        //get all serveice
        $services=Services::where(['deleted'=>1,'status'=>1])->get();
        return response()->json($services);
    }
}

and API route as below:-

Route::get('/Servicess', 'API\ServicesController@Services');
  1. it is necessary to make a component to send a request to using Axios request to get data and if yes how to tell the mobile developer about a link to access it.
  2. i want the steps from vue.js side to prepare data and send it using Axios



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire