angular retrieving user_id but not the name for the user

When a user submits data to a form, it retrieves the post with the title,body and name just fine

however when i refresh the page, the title and body stays in tack but the name for user disappears.

when i use post.user_id instead of it shows the user id on refresh but not the same for the name.

note: submitting a post works fine, and i do not need to specify a name for the user it justs know which user it is by who is logged in. I'm using laravel.

here is the html

    <div id="mypost" class="col-md-8 panel-default" ng-repeat="post in myposts" >
        <div id="eli-style-heading" class="panel-heading"><% post.title %></div>
            <div class="panel-body panel">
                    <p> <% post.body %></p>
                    by:<p><% %></p>


Controller in which angular calls to retrieve posts and stores post

 public function getPosts()

    $posts = Post::all();
    return json_encode($posts);

public function storePost(Request $request)
    $data = request()->validate([
     'title' => 'required|max:120',
     'body' => 'required|max:1000'

    $data['user_id'] = auth()->user()->id;
    $data['name'] = auth()->user()->name;

    $post = Post::create($data);

    $response = new Response(json_encode($data));
    $response->headers->set('Content-Type', 'application/json'); 

    // return redirect('/home')->withMessage('A new post was created.');

    return $response;


$scope.myposts = {};

$scope.addPost = function(){

    $'/auth/post', {
        title: $,
        body: $, 

    }).then(function(data, status, headers, config){


    $ = '';
    $ = '';


$scope.getPosts = function(){

        $scope.myposts =;
    }).then(function(data, status, header, config){