1 year ago

Value Button in Laravel View

Posted 1 year ago by wuschelino22

Hallo i have created a accordion with the button edit and the value of the button ist my cateregory id from the sql table. here is the accordion with the button:

div class="accordion" id="accordionExample">
@foreach ($categories as $categorie)

<div class="cars">
    <div class="card-header" id="headingSix">
      <h2 class="mb-0">
        <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse{{$categorie->id}}" aria-expanded="false" aria-controls="collapse{{$categorie->id}}" style="color: black">
        {{ $categorie->name}}

       <a href="{{ url('/edit') }}" class="btn btn-xs btn-info pull-right" input type="submit" value="{{$categorie->id}}" style="float: right; background-color: #3490dc">Edit</a>

    <div id="collapse{{$categorie->id}}" class="collapse" aria-labelledby="heading{{$categorie->id}}" data-parent="#accordionExample">
      <div class="card-body">

now i want to work with this value of the button in the edit-view. the edit view should only shows my entrys from the database wich category id is like the button i click in the index view on my accordion.

Can someone help me ? at the moment when i click all the buttons on my index blade in the edit blade the only get the id->variable for the frist category:-(

and i dont now how i only get the entrys from the database where the id is for example 1.

Thank you

Please sign in or create an account to participate in this conversation.