Last active
March 7, 2019 14:00
-
-
Save raank/1f9fb0ea0c5785169a974661b33a752d to your computer and use it in GitHub Desktop.
Revisions
-
raank renamed this gist
Mar 7, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
raank created this gist
Mar 7, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <?php class Controller { public function store(Request $request) { dd($request->redesSociais); // dumping foreach ($request->redesSociais as $index => $rede) { // $index = 0, 1, 2 // $rede = array de campos para cada rede foreach ($rede as $key => $value) { // $key = instagram, seguidores_instagram // $value = url do instagram, id selecionado no select } } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <form action="/nova/redesocial" method="POST"> @csrf <input type="url" class="form-control" value="{{ old('redesSociais.1.instagram') }}" id="instagram" name="redesSociais[1][instagram]" placeholder="https://www.instagram.com/"> <select class="form-control select2" name="redesSociais[1][seguidores_instagram]" style="width: 100%;"> <option selected>Selecione</option> @foreach ($seguidores as $item) <option value="{{ $item->id }}" @if(old('redesSociais.1.seguidores_instragram') === $item->id) selected @endif>{{ $item->estimativa_seguidores }}</option> @endforeach </select> </form>