These are chat archives for jadjoubran/laravel5-angular-material-starter

Jul 2016
Jesús López Morales
Jul 12 2016 11:20
I've a question
I'm trying to get 'all' post to the api
and in js i've this
this.API.all('posts').getList().then((result)=> {
But when i've execute this
i've this error
final-4f5b2f75c7.js:13708 Error: Response for getList SHOULD be an array and not an object or something else
Mark Kevin Besinga
Jul 12 2016 11:51
@jadjoubran imean that if I install it via npm. does it already include?
Mark Kevin Besinga
Jul 12 2016 13:41
how can I include a third party module? i downloaded it via npm or bower but I think it is not loaded. @jadjoubran i tried the answer on the link you give. and the error is Uncaught ReferenceError: angularDragula is not defined
Allan Alvarez Ortiz
Jul 12 2016 15:38
@jeslomo the error says all, it expects an array but receives an object, in your api routes, return arrays instead of json, for example:
public function get(){
         $users = App\User::get();

         return $users->toArray();
Allan Alvarez Ortiz
Jul 12 2016 15:52

Hi @besingamkb in your root app you should use bower install angular-dragula --save, then in you angular/index.modules.js add to the array of the module app.components: angularDragula(angular) example:

angular.module('app.components', [


Altough angular-dragula it's the official angular fork, i recommend you to use Dragular Instead, it's a much more rich feature wrapper than the official port, and it's simpler, besides the author of dragular, it's (almost, he is a very active contributor) the same manteiner as the official one,

Mark Kevin Besinga
Jul 12 2016 16:12
@flick36 that is what I do. but not working. hmm I manualy include the angular-dragula dist into index.main.php to make it work. anyways thanks again. i will try dragular too
Jesús López Morales
Jul 12 2016 16:18
Hi @flick36 instead i've return response()->json(Post::all());
response()->success wrap the response and in this case we need usa a restangular interceptor
Allan Alvarez Ortiz
Jul 12 2016 17:44
@besingamkb before posting my answer i try it myself and it's working perfectly :/
@jeslomo i didn't get it, did you solve your issu by using response()->json(Post::all()); or do you need a wrapper? xD