PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

API Keys Not Showing/Deleting

Solved
nick-jensen

Oct 19th, 2018 09:22 PM

I am trying to create an API key in a Wave app. It creates it in the DB but is not visibile.

You can also not edit the name or delete the key.

devdojo

Oct 20th, 2018 01:32 AM

Best Answer

Hey Nick,

What browser are you currently using? I've just tested on Chrome, Safari, and Firefox and they all seemed to be visible:

Let me know and we'll get to the bottom of it. Let me know if you also have any suggestions recommendations. Would love to hear them.

Thanks! Talk to you soon.

nick-jensen

Oct 20th, 2018 10:29 AM

I am on Chrome. Also tested on Firefox and get the same results.

https://www.useloom.com/share/16d39c485cba4bae9bdd6993612e5fdc

nick-jensen

Oct 20th, 2018 11:29 AM

In the debug mode for Edit Name and Delete, I am seeing Method not allowed.

https://pasteboard.co/HJkuzJK.png

devdojo

Oct 20th, 2018 01:29 PM

That is so strange,

Thanks for sharing the screencast. Have you modified any of the views, just want to try and weed out the problem. Can you possibly send me a private message and share with me your .env file.

Additionally, maybe we can coordinate a time to do a quick screen share, that would probably be the quickest way to resolve. Let me know if you have availability today :)

Talk to you soon. Also, not sure why pasteboard.co, is not displaying the images correctly. I plan to implement an image upload in the forums shortly.

nick-jensen

Oct 20th, 2018 01:33 PM

Great. I send you a message. I am around most of the day, working on this. It might be good to do a quick screen share as I am experiencing a few other issues regarding the Admin->Users view

devdojo

Oct 20th, 2018 01:37 PM

Ok, can you let me know the issue you are having with that as well, just so I can be prepared :)

Looking at your .env and trying a few things locally right now. And then perhaps we can do a screenshare here shortly.

nick-jensen

Oct 20th, 2018 01:41 PM

I'll try a different screen shot tool.

/admin/users "json_decode() expects parameter 1 to be string, object given (View: /Users/nicholasjensen/Sites/botwave/resources/views/vendor/voyager/users/browse.blade.php)"

https://snag.gy/47fRcL.jpg

devdojo

Oct 20th, 2018 02:43 PM

Thanks for sharing the screenshot. I'll be coordinating with you over private messages to schedule a time to do a screenshare :)

devdojo

Oct 20th, 2018 07:38 PM

Ok, here's a solution to the issue when saving users in the admin. It looks like I needed to include another field, so to override this admin view you will need to create a new file located in resources/views/vendor/voyager/users/ Name the file edit-add.blade.php, with the following contents:

@extends('voyager::master')

@section('page_title', __('voyager::generic.'.(isset($dataTypeContent->id) ? 'edit' : 'add')).' '.$dataType->display_name_singular)

@section('css')
    <meta name="csrf-token" content="{{ csrf_token() }}">
@stop

@section('page_header')
    <h1 class="page-title">
        <i class="{{ $dataType->icon }}"></i>
        {{ __('voyager::generic.'.(isset($dataTypeContent->id) ? 'edit' : 'add')).' '.$dataType->display_name_singular }}
    </h1>
@stop

@section('content')
    <div class="page-content container-fluid">
        <form class="form-edit-add" role="form"
              action="{{ (isset($dataTypeContent->id)) ? route('voyager.'.$dataType->slug.'.update', $dataTypeContent->id) : route('voyager.'.$dataType->slug.'.store') }}"
              method="POST" enctype="multipart/form-data" autocomplete="off">
            <!-- PUT Method if we are editing -->
            @if(isset($dataTypeContent->id))
                {{ method_field("PUT") }}
            @endif
            {{ csrf_field() }}

            <div class="row">
                <div class="col-md-8">
                    <div class="panel panel-bordered">
                    {{-- <div class="panel"> --}}
                        @if (count($errors) > 0)
                            <div class="alert alert-danger">
                                <ul>
                                    @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li>
                                    @endforeach
                                </ul>
                            </div>
                        @endif

                        <div class="panel-body">
                            <div class="form-group">
                                <label for="name">{{ __('voyager::generic.name') }}</label>
                                <input type="text" class="form-control" id="name" name="name" placeholder="{{ __('voyager::generic.name') }}"
                                       value="@if(isset($dataTypeContent->name)){{ $dataTypeContent->name }}@endif">
                            </div>

                            <div class="form-group">
                                <label for="email">{{ __('voyager::generic.email') }}</label>
                                <input type="email" class="form-control" id="email" name="email" placeholder="{{ __('voyager::generic.email') }}"
                                       value="@if(isset($dataTypeContent->email)){{ $dataTypeContent->email }}@endif">
                            </div>

                            <div class="form-group">
                                <label for="username">Username</label>
                                <input type="username" class="form-control" id="username" name="username" placeholder="Username"
                                       value="@if(isset($dataTypeContent->username)){{ $dataTypeContent->username }}@endif">
                            </div>

                            <div class="form-group">
                                <label for="password">{{ __('voyager::generic.password') }}</label>
                                @if(isset($dataTypeContent->password))
                                    <br>
                                    <small>{{ __('voyager::profile.password_hint') }}</small>
                                @endif
                                <input type="password" class="form-control" id="password" name="password" value="" autocomplete="new-password">
                            </div>

                            @can('editRoles', $dataTypeContent)

                                @php
                                    $dataTypeRows = $dataType->{(isset($dataTypeContent->id) ? 'editRows' : 'addRows' )};

                                    $row     = $dataTypeRows->where('field', 'user_belongsto_role_relationship')->first();
                                    $options = json_decode($row->details);
                                @endphp

                                <div class="form-group">
                                    <label for="role_id">Primary Role</label>
                                    @php $roles = TCG\Voyager\Models\Role::all(); @endphp
                                    <select name="role_id" id="role_id" class="select2" placeholder="">
                                        @foreach($roles as $role)
                                            <option value="{{ $role->id }}">{{ $role->name }}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="additional_roles">{{ __('voyager::profile.roles_additional') }}</label>
                                    @php
                                        $row     = $dataTypeRows->where('field', 'user_belongstomany_role_relationship')->first();
                                        $options = json_decode($row->details);
                                    @endphp
                                    @include('voyager::formfields.relationship')
                                </div>
                            @endcan
                        </div>
                    </div>
                </div>

                <div class="col-md-4">
                    <div class="panel panel panel-bordered panel-warning">
                        <div class="panel-body">
                            <div class="form-group">
                                @if(isset($dataTypeContent->avatar))
                                    <img src="{{ filter_var($dataTypeContent->avatar, FILTER_VALIDATE_URL) ? $dataTypeContent->avatar : Voyager::image( $dataTypeContent->avatar ) }}" style="width:200px; height:auto; clear:both; display:block; padding:2px; border:1px solid #ddd; margin-bottom:10px;" />
                                @endif
                                <input type="file" data-name="avatar" name="avatar">
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <button type="submit" class="btn btn-primary pull-right save">
                {{ __('voyager::generic.save') }}
            </button>
        </form>

        <iframe id="form_target" name="form_target" style="display:none"></iframe>
        <form id="my_form" action="{{ route('voyager.upload') }}" target="form_target" method="post" enctype="multipart/form-data" style="width:0px;height:0;overflow:hidden">
            {{ csrf_field() }}
            <input name="image" id="upload_file" type="file" onchange="$('#my_form').submit();this.value='';">
            <input type="hidden" name="type_slug" id="type_slug" value="{{ $dataType->slug }}">
        </form>
    </div>
@stop

@section('javascript')
    <script>
        $('document').ready(function () {
            $('.toggleswitch').bootstrapToggle();
        });
    </script>
@stop

You should now be able to add other users :) I'll make sure to tag a new release with these updates and I'll be helping you out with the other stuff we discussed.

Thanks! Let me know if that solution above worked for this issue.

devdojo

Oct 20th, 2018 07:39 PM

This is only for the admin functionality so it will have no effect on your application. It will only effect the admin area :)