I have confused, when passing data from Laravel which method to use for large amount of data?
use axios with api request. (does this secure) ? attaching data through props ? which is proper way? Thank you.
Given 2 scenario 1 is vuejs use axios get 2 is vuejs use props to get controller data which is effective and reduce load time or is there any other method
public function get_gallery_db(){
$gallery = Gallery::select('imgname','category')->orderBy('created_at', 'desc')->get();
return ($gallery);
}
created(){
axios.get('cms.test/get_gallery_db')
.then(response => {
this.gallerydb = response.data
})
},
public function users()
{
$users = User::all();
return view('admin.users', ['users'=>$users]);
}
<users :usersdata="{{ $users}}"></users>
export default {
name:'users',
props: ['usersdata'],
No responses yet.