Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 680826b0
authored
Sep 08, 2020
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify validation errors
1 parent
4e5cdebe
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
68 additions
and
72 deletions
app/Providers/AppServiceProvider.php
composer.lock
resources/js/Pages/Auth/Login.vue
resources/js/Pages/Contacts/Create.vue
resources/js/Pages/Contacts/Edit.vue
resources/js/Pages/Organizations/Create.vue
resources/js/Pages/Organizations/Edit.vue
resources/js/Pages/Users/Create.vue
resources/js/Pages/Users/Edit.vue
resources/js/Shared/SelectInput.vue
resources/js/Shared/TextInput.vue
resources/js/Shared/TextareaInput.vue
app/Providers/AppServiceProvider.php
View file @
680826b
...
...
@@ -55,11 +55,6 @@ class AppServiceProvider extends ServiceProvider
'error'
=>
Session
::
get
(
'error'
),
];
},
'errors'
=>
function
()
{
return
Session
::
get
(
'errors'
)
?
Session
::
get
(
'errors'
)
->
getBag
(
'default'
)
->
getMessages
()
:
(
object
)
[];
},
]);
}
...
...
composer.lock
View file @
680826b
This diff is collapsed.
Click to expand it.
resources/js/Pages/Auth/Login.vue
View file @
680826b
...
...
@@ -6,7 +6,7 @@
<div
class=
"px-10 py-12"
>
<h1
class=
"text-center font-bold text-3xl"
>
Welcome Back!
</h1>
<div
class=
"mx-auto mt-6 w-24 border-b-2"
/>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"mt-10"
label=
"Email"
type=
"email"
autofocus
autocapitalize=
"off"
/>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"mt-10"
label=
"Email"
type=
"email"
autofocus
autocapitalize=
"off"
/>
<text-input
v-model=
"form.password"
class=
"mt-6"
label=
"Password"
type=
"password"
/>
<label
class=
"mt-6 select-none flex items-center"
for=
"remember"
>
<input
id=
"remember"
v-model=
"form.remember"
class=
"mr-1"
type=
"checkbox"
>
...
...
resources/js/Pages/Contacts/Create.vue
View file @
680826b
...
...
@@ -7,23 +7,23 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.first_name"
:error
s=
"$page.
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
s=
"$page.
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<select-input
v-model=
"form.organization_id"
:error
s=
"$page.
errors.organization_id"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Organization"
>
<text-input
v-model=
"form.first_name"
:error
=
"
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
=
"
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<select-input
v-model=
"form.organization_id"
:error
=
"
errors.organization_id"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Organization"
>
<option
:value=
"null"
/>
<option
v-for=
"organization in organizations"
:key=
"organization.id"
:value=
"organization.id"
>
{{
organization
.
name
}}
</option>
</select-input>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
s=
"$page.
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
s=
"$page.
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
s=
"$page.
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
s=
"$page.
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
s=
"$page.
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
=
"
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
=
"
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
=
"
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
=
"
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
=
"
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<option
:value=
"null"
/>
<option
value=
"CA"
>
Canada
</option>
<option
value=
"US"
>
United States
</option>
</select-input>
<text-input
v-model=
"form.postal_code"
:error
s=
"$page.
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
<text-input
v-model=
"form.postal_code"
:error
=
"
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center"
>
<loading-button
:loading=
"sending"
class=
"btn-indigo"
type=
"submit"
>
Create Contact
</loading-button>
...
...
@@ -48,6 +48,7 @@ export default {
TextInput
,
},
props
:
{
errors
:
Object
,
organizations
:
Array
,
},
remember
:
'form'
,
...
...
resources/js/Pages/Contacts/Edit.vue
View file @
680826b
...
...
@@ -11,23 +11,23 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.first_name"
:error
s=
"$page.
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
s=
"$page.
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<select-input
v-model=
"form.organization_id"
:error
s=
"$page.
errors.organization_id"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Organization"
>
<text-input
v-model=
"form.first_name"
:error
=
"
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
=
"
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<select-input
v-model=
"form.organization_id"
:error
=
"
errors.organization_id"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Organization"
>
<option
:value=
"null"
/>
<option
v-for=
"organization in organizations"
:key=
"organization.id"
:value=
"organization.id"
>
{{
organization
.
name
}}
</option>
</select-input>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
s=
"$page.
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
s=
"$page.
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
s=
"$page.
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
s=
"$page.
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
s=
"$page.
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
=
"
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
=
"
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
=
"
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
=
"
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
=
"
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<option
:value=
"null"
/>
<option
value=
"CA"
>
Canada
</option>
<option
value=
"US"
>
United States
</option>
</select-input>
<text-input
v-model=
"form.postal_code"
:error
s=
"$page.
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
<text-input
v-model=
"form.postal_code"
:error
=
"
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center"
>
<button
v-if=
"!contact.deleted_at"
class=
"text-red-600 hover:underline"
tabindex=
"-1"
type=
"button"
@
click=
"destroy"
>
Delete Contact
</button>
...
...
@@ -59,6 +59,7 @@ export default {
TrashedMessage
,
},
props
:
{
errors
:
Object
,
contact
:
Object
,
organizations
:
Array
,
},
...
...
resources/js/Pages/Organizations/Create.vue
View file @
680826b
...
...
@@ -7,18 +7,18 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.name"
:error
s=
"$page.
errors.name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Name"
/>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
s=
"$page.
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
s=
"$page.
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
s=
"$page.
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
s=
"$page.
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
s=
"$page.
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<text-input
v-model=
"form.name"
:error
=
"
errors.name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Name"
/>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
=
"
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
=
"
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
=
"
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
=
"
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
=
"
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<option
:value=
"null"
/>
<option
value=
"CA"
>
Canada
</option>
<option
value=
"US"
>
United States
</option>
</select-input>
<text-input
v-model=
"form.postal_code"
:error
s=
"$page.
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
<text-input
v-model=
"form.postal_code"
:error
=
"
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center"
>
<loading-button
:loading=
"sending"
class=
"btn-indigo"
type=
"submit"
>
Create Organization
</loading-button>
...
...
@@ -42,6 +42,9 @@ export default {
SelectInput
,
TextInput
,
},
props
:
{
errors
:
Object
,
},
remember
:
'form'
,
data
()
{
return
{
...
...
resources/js/Pages/Organizations/Edit.vue
View file @
680826b
...
...
@@ -11,18 +11,18 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.name"
:error
s=
"$page.
errors.name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Name"
/>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
s=
"$page.
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
s=
"$page.
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
s=
"$page.
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
s=
"$page.
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
s=
"$page.
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<text-input
v-model=
"form.name"
:error
=
"
errors.name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Name"
/>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.phone"
:error
=
"
errors.phone"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Phone"
/>
<text-input
v-model=
"form.address"
:error
=
"
errors.address"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Address"
/>
<text-input
v-model=
"form.city"
:error
=
"
errors.city"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"City"
/>
<text-input
v-model=
"form.region"
:error
=
"
errors.region"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Province/State"
/>
<select-input
v-model=
"form.country"
:error
=
"
errors.country"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Country"
>
<option
:value=
"null"
/>
<option
value=
"CA"
>
Canada
</option>
<option
value=
"US"
>
United States
</option>
</select-input>
<text-input
v-model=
"form.postal_code"
:error
s=
"$page.
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
<text-input
v-model=
"form.postal_code"
:error
=
"
errors.postal_code"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Postal code"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center"
>
<button
v-if=
"!organization.deleted_at"
class=
"text-red-600 hover:underline"
tabindex=
"-1"
type=
"button"
@
click=
"destroy"
>
Delete Organization
</button>
...
...
@@ -90,6 +90,7 @@ export default {
TrashedMessage
,
},
props
:
{
errors
:
Object
,
organization
:
Object
,
},
remember
:
'form'
,
...
...
resources/js/Pages/Users/Create.vue
View file @
680826b
...
...
@@ -7,15 +7,15 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.first_name"
:error
s=
"$page.
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
s=
"$page.
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.password"
:error
s=
"$page.
errors.password"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"password"
autocomplete=
"new-password"
label=
"Password"
/>
<select-input
v-model=
"form.owner"
:error
s=
"$page.
errors.owner"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Owner"
>
<text-input
v-model=
"form.first_name"
:error
=
"
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
=
"
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.password"
:error
=
"
errors.password"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"password"
autocomplete=
"new-password"
label=
"Password"
/>
<select-input
v-model=
"form.owner"
:error
=
"
errors.owner"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Owner"
>
<option
:value=
"true"
>
Yes
</option>
<option
:value=
"false"
>
No
</option>
</select-input>
<file-input
v-model=
"form.photo"
:error
s=
"$page.
errors.photo"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"file"
accept=
"image/*"
label=
"Photo"
/>
<file-input
v-model=
"form.photo"
:error
=
"
errors.photo"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"file"
accept=
"image/*"
label=
"Photo"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center"
>
<loading-button
:loading=
"sending"
class=
"btn-indigo"
type=
"submit"
>
Create User
</loading-button>
...
...
@@ -41,6 +41,9 @@ export default {
TextInput
,
FileInput
,
},
props
:
{
errors
:
Object
,
},
remember
:
'form'
,
data
()
{
return
{
...
...
resources/js/Pages/Users/Edit.vue
View file @
680826b
...
...
@@ -14,15 +14,15 @@
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"submit"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.first_name"
:error
s=
"$page.
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
s=
"$page.
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<text-input
v-model=
"form.email"
:error
s=
"$page.
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.password"
:error
s=
"$page.
errors.password"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"password"
autocomplete=
"new-password"
label=
"Password"
/>
<select-input
v-model=
"form.owner"
:error
s=
"$page.
errors.owner"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Owner"
>
<text-input
v-model=
"form.first_name"
:error
=
"
errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error
=
"
errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
<text-input
v-model=
"form.email"
:error
=
"
errors.email"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Email"
/>
<text-input
v-model=
"form.password"
:error
=
"
errors.password"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"password"
autocomplete=
"new-password"
label=
"Password"
/>
<select-input
v-model=
"form.owner"
:error
=
"
errors.owner"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Owner"
>
<option
:value=
"true"
>
Yes
</option>
<option
:value=
"false"
>
No
</option>
</select-input>
<file-input
v-model=
"form.photo"
:error
s=
"$page.
errors.photo"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"file"
accept=
"image/*"
label=
"Photo"
/>
<file-input
v-model=
"form.photo"
:error
=
"
errors.photo"
class=
"pr-6 pb-8 w-full lg:w-1/2"
type=
"file"
accept=
"image/*"
label=
"Photo"
/>
</div>
<div
class=
"px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center"
>
<button
v-if=
"!user.deleted_at"
class=
"text-red-600 hover:underline"
tabindex=
"-1"
type=
"button"
@
click=
"destroy"
>
Delete User
</button>
...
...
@@ -56,6 +56,7 @@ export default {
TrashedMessage
,
},
props
:
{
errors
:
Object
,
user
:
Object
,
},
remember
:
'form'
,
...
...
resources/js/Shared/SelectInput.vue
View file @
680826b
<
template
>
<div>
<label
v-if=
"label"
class=
"form-label"
:for=
"id"
>
{{
label
}}
:
</label>
<select
:id=
"id"
ref=
"input"
v-model=
"selected"
v-bind=
"$attrs"
class=
"form-select"
:class=
"
{ error: error
s.length
}">
<select
:id=
"id"
ref=
"input"
v-model=
"selected"
v-bind=
"$attrs"
class=
"form-select"
:class=
"
{ error: error }">
<slot
/>
</select>
<div
v-if=
"error
s.length"
class=
"form-error"
>
{{
errors
[
0
]
}}
</div>
<div
v-if=
"error
"
class=
"form-error"
>
{{
error
}}
</div>
</div>
</
template
>
...
...
@@ -20,10 +20,7 @@ export default {
},
value
:
[
String
,
Number
,
Boolean
],
label
:
String
,
errors
:
{
type
:
Array
,
default
:
()
=>
[],
},
error
:
String
,
},
data
()
{
return
{
...
...
resources/js/Shared/TextInput.vue
View file @
680826b
<
template
>
<div>
<label
v-if=
"label"
class=
"form-label"
:for=
"id"
>
{{
label
}}
:
</label>
<input
:id=
"id"
ref=
"input"
v-bind=
"$attrs"
class=
"form-input"
:class=
"
{ error: error
s.length
}" :type="type" :value="value" @input="$emit('input', $event.target.value)">
<div
v-if=
"error
s.length"
class=
"form-error"
>
{{
errors
[
0
]
}}
</div>
<input
:id=
"id"
ref=
"input"
v-bind=
"$attrs"
class=
"form-input"
:class=
"
{ error: error }" :type="type" :value="value" @input="$emit('input', $event.target.value)">
<div
v-if=
"error
"
class=
"form-error"
>
{{
error
}}
</div>
</div>
</
template
>
...
...
@@ -22,10 +22,7 @@ export default {
},
value
:
String
,
label
:
String
,
errors
:
{
type
:
Array
,
default
:
()
=>
[],
},
error
:
String
,
},
methods
:
{
focus
()
{
...
...
resources/js/Shared/TextareaInput.vue
View file @
680826b
<
template
>
<div>
<label
v-if=
"label"
class=
"form-label"
:for=
"id"
>
{{
label
}}
:
</label>
<textarea
:id=
"id"
ref=
"input"
v-bind=
"$attrs"
class=
"form-textarea"
:class=
"
{ error: error
s.length
}" :value="value" @input="$emit('input', $event.target.value)" />
<div
v-if=
"error
s.length"
class=
"form-error"
>
{{
errors
[
0
]
}}
</div>
<textarea
:id=
"id"
ref=
"input"
v-bind=
"$attrs"
class=
"form-textarea"
:class=
"
{ error: error }" :value="value" @input="$emit('input', $event.target.value)" />
<div
v-if=
"error
"
class=
"form-error"
>
{{
error
}}
</div>
</div>
</
template
>
...
...
@@ -18,10 +18,7 @@ export default {
},
value
:
String
,
label
:
String
,
errors
:
{
type
:
Array
,
default
:
()
=>
[],
},
error
:
String
,
},
methods
:
{
focus
()
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment