סמן כל משימה שמבוצעת (ההתקדמות נשמרת אוטומטית)
jasmine-migrator
bin/jasmine-upgrade ../path-to-project --apply
public/jasmine-public
composer update
php artisan migrate
php artisan jasmine:link-public-assets
package.json
inertia
pnpm i
pnpm run build
php artisan vendor:publish --provider="Inertia\ServiceProvider" --force
pages.paths.0
builds/default/js/Pages
JasmineTest.php
can access the api
test('can access the api', function () { /** @var JasmineUser $user */ $user = JasmineUser::factory()->create(['admin' => true, 'password' => 'password']); actingAs($user, config('jasmine.auth.guard')); post(route('jasmine.profile.show'), [ '_sec' => 'createToken', 'password' => 'password', 'name' => 'test', ])->assertSessionHasNoErrors(); $token = session('swal.inputValue'); $response = $this->get(route('jasmine.api.info'), [ 'Authorization' => 'Bearer ' . $token, ]); $response->assertStatus(200) ->assertHeader('Content-Type', 'application/json') ->assertJsonStructure(['php', 'laravel', 'jasmine']); });
jLoad
static:
App\Traits\Privateable.php
<?php namespace App\Traits; use Illuminate\Database\Eloquent\Builder; use Jasmine\Jasmine\Bread\Fields\SwitchField; use Jasmine\Jasmine\Models\JasminePage; trait Privateable { public static function bootPrivateable() { static::addGlobalScope('privateable', function (Builder $query) { if (request()->user(config('jasmine.auth.guard'))) return; /** @phpstan-ignore function.alreadyNarrowedType, instanceof.alwaysFalse, function.impossibleType */ if (is_a($query->getModel(), JasminePage::class)) { $query->where('content->' . app()->getLocale() . '->private', false); } else $query->where('private', false); }); } public static function privateSwitch(): SwitchField { $entity = strtolower(static::getSingularName()); return SwitchField::for('private') ->setDescription(__('When private only logged users can see this :entity.', ['entity' => $entity])); } }
Jasmine API
Jasmine web
Route::prefix('jasmine')->middleware('web')->group(fn() => Jasmine::routes()); Route::prefix('jasmine')->middleware('api')->group(fn() => Jasmine::apiRoutes());
tsconfig.json
jasmine-vue
{ "compilerOptions": { "paths": { "@jasmine/js/components/*": ["../../vendor/jasminecms/jasmine/resources/js/components/*"], "@jasmine/js/layouts/*": ["../../vendor/jasminecms/jasmine/resources/js/layouts/*"], "@jasmine/js/composeables/*": ["../../vendor/jasminecms/jasmine/resources/js/composeables/*"], "@jasmine/js/directives/*": ["../../vendor/jasminecms/jasmine/resources/js/directives/*"], "@jasmine/js/lib/*": ["../../vendor/jasminecms/jasmine/resources/js/lib/*"], "@jasmine/js/utils": ["../../vendor/jasminecms/jasmine/resources/js/utils.ts"], "vue": ["../../node_modules/vue"], "@inertiajs/vue3": ["../../node_modules/@inertiajs/vue3"] } }, "include": ["**/*.ts", "**/*.d.ts", "**/*.vue"], "exclude": ["node_modules"] }
resources/jasmine-vue/Embedded.vue
<template> <Head :title="title" /> <AppLayout> <iframe :src="url" width="100%" height="775" frameborder="0" /> </AppLayout> </template> <script setup> import { Head } from '@inertiajs/vue3'; import AppLayout from '@jasmine/js/layouts/AppLayout.vue'; defineProps({ title: { type: String, required: true }, url: { type: String, required: true }, }); </script>
php artisan test --coverage
git pull
nano .env
rm -rf public/jasmine-public
php artisan optimize
php artisan jasmine:link
pnpm run prod