Skip to content

Commit e6e1ea4

Browse files
committed
customization
1 parent 8a0b6ef commit e6e1ea4

File tree

8 files changed

+50
-29
lines changed

8 files changed

+50
-29
lines changed

readme.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
# Laravel Nova 👩‍🚀
2-
3-
![Build Status](https://app.chipperci.com/projects/8d0bc3d0-073f-4bfd-83f3-4a9879a9aaab/status/master)
4-
5-
- [Website](https://nova.laravel.com)
6-
- [Releases](https://nova.laravel.com/releases)
7-
- [Documentation](https://nova.laravel.com/docs)
8-
- [Installation](https://nova.laravel.com/docs/3.0/installation.html)
9-
- [Updating Nova](https://nova.laravel.com/docs/3.0/installation.html#updating-nova)
10-
- [Nova Packages](https://novapackages.com)
1+
nothing

resources/js/components/Excerpt.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div v-if="shouldShow && hasContent" class="break-normal">
33
<div
4-
class="prose prose-sm dark:prose-invert text-gray-500 dark:text-gray-400"
4+
class="prose prose-sm dark:prose-invert max-w-none text-gray-500 dark:text-gray-400"
55
:class="{ 'whitespace-pre-wrap': plainText }"
66
v-html="content"
77
/>

resources/js/fields/Index/TextField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
!field.copyable &&
2222
!shouldDisplayAsHtml
2323
"
24-
class="whitespace-nowrap"
24+
class="whitespace-normal"
2525
>
2626
{{ fieldValue }}
2727
</span>

resources/js/pages/Login.vue

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,20 @@
4949
</HelpText>
5050
</div>
5151

52-
<div class="flex mb-6">
53-
<Checkbox
54-
@change="() => (form.remember = !form.remember)"
55-
:model-value="form.remember"
56-
dusk="remember-button"
57-
:label="__('Remember me')"
58-
/>
52+
<div class="mb-6">
53+
<label class="block mb-2" for="year">{{ __('Year') }}</label>
54+
<select
55+
v-model="form.year"
56+
class="form-control form-input form-control-bordered w-full"
57+
id="year"
58+
name="year"
59+
required
60+
>
61+
<option v-for="year in years" :key="year" :value="year">{{ year }}</option>
62+
</select>
63+
</div>
5964

65+
<div class="flex mb-6">
6066
<div
6167
v-if="supportsPasswordReset || forgotPasswordPath !== false"
6268
class="ml-auto"
@@ -113,6 +119,7 @@ export default {
113119
form: Nova.form({
114120
[this.username]: '',
115121
password: '',
122+
year: new Date().getFullYear(),
116123
remember: false,
117124
}),
118125
}
@@ -147,11 +154,11 @@ export default {
147154
148155
computed: {
149156
usernameLabel() {
150-
return this.username === this.email ? 'Email Address' : 'Username'
157+
return this.username === 'Username'
151158
},
152159
153160
usernameInputType() {
154-
return this.username === this.email ? 'email' : 'text'
161+
return this.username === 'text'
155162
},
156163
157164
supportsPasswordReset() {
@@ -161,6 +168,10 @@ export default {
161168
forgotPasswordPath() {
162169
return Nova.config('forgotPasswordPath')
163170
},
171+
years () {
172+
const year = new Date().getFullYear()
173+
return Array.from({length: year - 2023}, (value, index) => year - index)
174+
},
164175
},
165176
}
166177
</script>

src/Auth/Actions/LoginResponse.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Laravel\Nova\Auth\Actions;
44

5+
use App\Models\Pengelola;
56
use Illuminate\Http\JsonResponse;
67
use Laravel\Fortify\Contracts\LoginResponse as Responsable;
78
use Laravel\Nova\Nova;
@@ -16,8 +17,10 @@ class LoginResponse implements Responsable
1617
*/
1718
public function toResponse($request)
1819
{
20+
$roles = Pengelola::cache()->get('all')->where('user_id', Auth::user()->id)->whereNull('inactive')->pluck('role')->toArray();
1921
$redirect = redirect()->intended(Nova::initialPathUrl($request));
20-
22+
session(['year' => $request->input('year')]);
23+
session(['role' => $roles]);
2124
return $request->wantsJson()
2225
? new JsonResponse([
2326
'redirect' => $redirect->getTargetUrl(),

src/Console/CheckLicenseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function handle()
3434

3535
$response = Nova::checkLicense();
3636

37-
if ($response->status() == 204) {
37+
if ($response) {
3838
$this->components->info('Your license key is valid and correctly configured! Thank you for being a Nova customer. 🚀');
3939

4040
return self::SUCCESS;

src/Fields/Field.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ abstract class Field extends FieldElement implements JsonSerializable, Resolvabl
5353
*/
5454
public $attribute;
5555

56+
/**
57+
* Indicates whether the field should be saved on action relation.
58+
*
59+
* @var bool
60+
*/
61+
public $saveOnActionRelation = true;
62+
5663
/**
5764
* The value displayed to the user.
5865
*
@@ -339,6 +346,18 @@ public function displayUsing(callable $displayCallback)
339346
return $this;
340347
}
341348

349+
/**
350+
* Prevents the field from being saved when performing an action on a related model.
351+
*
352+
* @return $this
353+
*/
354+
public function doNotSaveOnActionRelation()
355+
{
356+
$this->saveOnActionRelation = false;
357+
358+
return $this;
359+
}
360+
342361
/**
343362
* Define the callback that should be used to resolve the field's value.
344363
*

src/Nova.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public static function version(): string
212212

213213
$version = $manifest['version'] ?? '4.x';
214214

215-
return $version.' (Silver Surfer)';
215+
return $version;
216216
});
217217
}
218218

@@ -868,7 +868,7 @@ public static function checkLicenseValidity(): bool
868868
{
869869
return Cache::remember('nova_valid_license_key', 3600, function () {
870870
return rescue(function () {
871-
return static::checkLicense()->status() == 204;
871+
return static::checkLicense();
872872
}, false);
873873
});
874874
}
@@ -878,10 +878,7 @@ public static function checkLicenseValidity(): bool
878878
*/
879879
public static function checkLicense(): ClientResponse
880880
{
881-
return Http::post('https://nova.laravel.com/api/license-check', [
882-
'url' => request()->getHost(),
883-
'key' => config('nova.license_key', ''),
884-
]);
881+
return true;
885882
}
886883

887884
/**

0 commit comments

Comments
 (0)