How do I give a variable to my blade and save them to a variable?

Viewed 54

My problem is a little bit complicated to explain. I'm doing a blog and did something like a topic section. I have a topic table and a thread table. In my thread table is a 'topic' attribute. No I want that if I'm doing a new thread, I also want to save the topic, the user currently is in right now.

My send button with the variable is this:

<a href="{{ action('Test\\TestController@add', [$thread->thema]) }}">
    <div class="btn btn-primary">Thread hinzufügen</div>
</a>

My add-route:

Route::get('/add/{thread}', 'Test\\TestController@add');

My controller function just send's me to the thread creating form.

My creating thread - form :

{!! Former::horizontal_open()->action(action('Test\\TestController@store')) !!}
{!! Former::text('thread')->label('Title:')->autofocus() !!}
{!! Former::textarea('content')->label('Content')->rows(10) !!}
{!! Former::large_primary_submit('Add Thread') !!}
{!! Former::close() !!}

Well, after I pressed the submit button, the thread get saved, but without the topic! :/

1 Answers
Related