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 component to send request to using axios request to get data and if yes how to tell mobile developer about 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