Part 37 - Adding Tag UI/UX [How to Build a Blog with Laravel 5 Series]
Why Stack Overflow recommends it
Stack Overflow users link it when they are following this series and need to show the Select2 multi-select or the post-to-tags many-to-many code they are trying to reproduce.
Recommended by 0 people across 0 different months, 2018 to 2020.
What it is
Part 37 of DevMarketer's Laravel 5 blog-building tutorial series, presented by Alex (J. Curtis). It adds a tag selector to the post form using the Select2 jQuery plugin and wires up the many-to-many relationship between posts and tags with sync().
What people said
Cites Ali A. · 2018-11 · Stack Overflow · on “laravel Error: Array to string conversion”
I am following the process as Alex is following in many to many relations in his youtube tutorial. I have also seen in many tutorials for the many to many relationships. But in my case its not working. Please check this 33:00 to 33:35 in this tutorial [this video] –
Cites Splendor Bean · 2019-07 · Stack Overflow · on “BadMethodCallException Call to undefined method App\Post::tags()”
Im working on my Laravel project, and have a problem with many-to-many relationship : cannot use "sync" function to store the data in Intermediary Table. Im following the tutorial in this series : Part 37 - Adding Tag UI/UX [this video] Problem seems to be with this code line : $post->tags()->sync($request->tags, false); It throws back the error : BadMethodCallException Call to undefined method App\Post::tags() I have tried to use attach function instead of sync , does not work. I dont know which part of code could lead to this issue. Pls tell me if u guys notice anythings. Tysm ! Post.php (Model) namespace App; use Illuminate\Database\Eloquent\Model; class Post extends Model { protected $table =
Cites Roomal Jayaratne · 2020-10 · Stack Overflow · on “How to use gentelella alela select2 option in laravel”
I found they have select2 file in their vendor folder, so i linked them (those links works when i open these two files in web browser). in header <link href="{{asset('adminbackend/vendors/select2/dist/css/select2.min.css')}}" rel="stylesheet"> in Footer <script src="{{asset('adminbackend/vendors/select2/dist/js/select2.full.js')}}"></script> in body <div class="item form-group"> <select class="form-control select2-multi" name="tags[]"> @foreach($tags as $tag) <option value="{{$tag->id}}"> {{$tag->name}} </option> @endforeach </select> </div> in body <script type="text/javascript"> $(.select2-multi').select2(); </script> but, still it not working.. this code found in here [this video]