mardi 30 avril 2019

how to return multiple results using api controller in laravel and vuejs

I,m building a project using Laravel and Vuejs, I'm using API controllers. I want to fetch the number of users.

User controller :

public function index() { return User::where('type','!=','admin'); }

User.vue :

axios.get('api/user').then(({data})=>(this.enseignants=data.data));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire