For anyone who encounters this topic and still gets errors, the answer is correctly given above by Mustafa Ehsan, but not explained. The trial and error method helped me see this.
My component in newuser.blade.php
<access-request firstname="{{ $newuser->firstname }}" lastname="{{ $newuser->lastname }}" accessid="{{ $newuser->id }}" > </access-request>
It is very important to note the binding method used. On the aforementioned component, I wrote only the name of the data binding (for example, React details), and then registered it with the component details (see below). This is how Mustafa wrote his answer in his answer and works great. Another, more convenient way to pass props is v-bind: or:, but you must make sure that you use both double and single quotes:
:firstname="'{{ $newuser->firstname }}'"
Without both quotes, you will receive Vue warnings.
AccessRequest.vue:
<template> <div class="component"> <h3 class="">{{ firstname }} {{ lastname }}</h3> <p>Access ID: {{ accessid }}</p> <label for="administrator">Grant Administrator Priviledges:</label> <input name="administrator" type="checkbox" value="True" class="mb-5"><br> <button type="submit" class="btn btn-success">Add</button> <button type="submit" class="btn btn-danger">Delete</button> <hr> </div> </template> <script> export default { name: "AccessRequest", props: ['firstname', 'lastname', 'accessid'], } </script>
Jonathan whittle
source share