whats the differences between them? im building spa and most of the extra attribute are attached inside api resource class, can some one clarify this for me?
The model's $append property defines an array of computed properties derived from Accessor methods which will be appended the to Array Representation of a Model instance.
An Eloquent API Resource allows you to structure and format a Model instance and it's loaded relations as a JSON API response.
Generally, I would suggest an API response if your project is non-trivial; you don't want your API changing everytime a column is added/removed from a database table.
Essentially, you will get the same API response payload, yes.
Whenever you start using the $hidden Model property to hide properties from Array Representation of a Model, it is past time to look at an alternative approach.
You can override the toArray method on the Model class as well to define the array/JSON structure and format, but again I would tend towards API Resources in those cases.