1

Can anyone have a look at this, cant figure out why the last line is causing the following error:

syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

public function show($id)
{
    $post = Post::find($id);
    $date = $post->created_at;
    setlocale(LC_TIME, 'GB');
    $date = $date->formatlocalized('%A %d %B %Y');
    return View::make('posts.show')->('post', $post)with->('date', $date);
}

2 Answers 2

1

Expanding on @Log1c initial answer, you've opened a parenthesis to nothing:

return View::make('posts.show')->('post', $post)->with('date', $date);
                             // ^-- HERE, there's no function call

Could be you meant to use with() there, too?

return View::make('posts.show')->with('post', $post)->with('date', $date);
Sign up to request clarification or add additional context in comments.

Comments

0

Instead:

return View::make('posts.show')->('post', $post)with->('date', $date);

it should be:

return View::make('posts.show')->with('post', $post)->with('date', $date);

change location of -> as you are calling method with(), calling method like with->() is invalid syntax and also add one more with().

2 Comments

Hi thanks, I tried what you suggested but still getting the same error. steppic.com/show/5e8e0f33b20aad5957bb86d9e9d08a1f.html
@runyards, I think now you could at-least voteup. if you found any effort in answer provided

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.