多🌹444收拾收拾计算机视觉手机手机手机手机4大尺寸惆怅长岑长 ??????????????????????????С??????????????P??????????????????????????????????????????????????????^?????????? ????j?????????? ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!PK!GW]¬8ÊýÜÜCdatabase/migrations/2025_09_08_072943_create_ai_music_pro_table.phpnu„[µü¤id(); $table->unsignedBigInteger('user_id')->index(); $table->string('file_path')->nullable(); $table->string('workbook_title'); $table->text('ai_music_prompt'); $table->integer('duration')->nullable(); $table->string('music_style')->nullable(); $table->timestamps(); // foreign key to users table $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('ai_music_pro'); } }; PK!GW]ËX²««Fdatabase/migrations/2025_09_08_072943_add_music_slug_to_free_items.phpnu„[µü¤free_open_ai_items; if (is_array($freeOpenAiItems) && ! in_array($slug, $freeOpenAiItems)) { $freeOpenAiItems[] = $slug; $settings->free_open_ai_items = $freeOpenAiItems; $settings->save(); Setting::forgetCache(); } } /** * Reverse the migrations. */ public function down(): void {} }; PK!GW] ƒšL……extension.jsonnu„[µü¤{ "name": "AiMusicPro", "type": "extension", "version": "1.1.0", "description": "AiMusicPro extension for magicai" } PK!GW]’ç‚g$System/AiMusicProServiceProvider.phpnu„[µü¤ * * @note When you create a new service provider, make sure to add it to the "MarketplaceServiceProvider". Otherwise, your Laravel application won’t recognize this provider, and the related functions won’t work properly. * @note If you want to perform a specific action when an extension is uninstalled, you can use the UninstallExtensionServiceProviderInterface. By implementing this interface, you can define custom operations that will be triggered during the uninstallation of the extension. * @note The registerKey() method is used to provide a unique identifier for the extension, which is essential for the healthy check and other functionalities. */ class AiMusicProServiceProvider extends ServiceProvider implements ExtensionRegisterKeyProviderInterface, UninstallExtensionServiceProviderInterface { public function register(): void { $this->registerConfig(); } public function boot(Kernel $kernel): void { $this->registerTranslations() ->registerViews() ->registerRoutes() ->registerMigrations() ->publishAssets() ->registerComponents(); } public function registerComponents(): static { // $this->loadViewComponentsAs('ai-music-pro', []); return $this; } public function publishAssets(): static { $this->publishes([ // __DIR__ . '/../resources/assets/js' => public_path('vendor/ai-music-pro/js'), // __DIR__ . '/../resources/assets/images' => public_path('vendor/ai-music-pro/images'), ], 'extension'); return $this; } public function registerConfig(): static { $this->mergeConfigFrom(__DIR__ . '/../config/aimusicpro.php', 'ai-music-pro'); return $this; } protected function registerTranslations(): static { $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'ai-music-pro'); return $this; } public function registerViews(): static { $this->loadViewsFrom([__DIR__ . '/../resources/views'], 'ai-music-pro'); return $this; } public function registerMigrations(): static { $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); return $this; } private function registerRoutes(): static { $this->router() ->group([ 'middleware' => ['web', 'auth'], 'prefix' => 'dashboard/user/ai-music-pro/', 'as' => 'dashboard.user.ai-music-pro.', 'controller' => AiMusicProController::class, ], function (Router $router) { $router->get('/', 'index')->name('index')->middleware(CheckTemplateTypeAndPlan::class); $router->post('/generate', 'generate')->name('generate'); $router->get('/delete/{id}', 'delete')->name('delete'); }); return $this; } private function router(): Router|Route { return $this->app['router']; } public static function uninstall(): void { // TODO: Implement uninstall() method. } public function registerKey(): string { return 'ai-music-pro'; } } PK!GW]dYD¦¦System/Models/AiMusicPro.phpnu„[µü¤id())->orderBy('id', 'desc')->paginate(10); return view('ai-music-pro::index', compact('music')); } public function generate(Request $request): JsonResponse { $request->validate([ 'workbook_title' => 'required|string|max:190', 'ai_music_prompt' => 'required|string|max:2000', 'duration' => 'nullable|integer|min:10|max:300', 'music_style' => 'nullable|string|max:190', ]); $isDemo = Helper::appIsDemo(); // --- DEMO MODE CHECK (BEFORE GENERATION) --- if ($isDemo) { $duration = (int) $request->get('duration', 30); // Assume 30 seconds if not specified $chkLmt = Helper::checkDemoSecondDailyLimit($duration); if ($chkLmt->getStatusCode() === 429) { return response()->json(['message' => $chkLmt->getData()->message, 'type' => 'error']); } } $driver = Entity::driver(EntityEnum::ELEVENLABS_AI_MUSIC)->inputMinute(1)->calculateCredit(); try { $driver->redirectIfNoCreditBalance(); } catch (Exception $e) { return response()->json(['message' => $e->getMessage(), 'type' => 'error']); } $param = [ 'prompt' => $request->get('ai_music_prompt', ''), 'model_id' => 'music_v1', ]; if ($request->filled('duration')) { $param['music_length_ms'] = $request->get('duration') * 1000; } if ($request->filled('music_style')) { $param['prompt'] .= ', in the style of ' . $request->get('music_style'); } $elevenlabsService = new PackageElevenlabsService(ApiHelper::setElevenlabsKey()); $response = $elevenlabsService->AiMusicModel()->submit($param); $fileUrl = $response->getData(true)['file_url'] ?? null; if (empty($fileUrl)) { return response()->json(['message' => __('Failed to generate music. Please try again.'), 'type' => 'error']); } $uploadsPath = public_path('uploads/' . $fileUrl); if ($request->filled('duration')) { $voiceLengthMinutes = $request->get('duration') / 60; } else { $voiceLengthMinutes = measureVoiceLength($uploadsPath); } $driver->inputMinute($voiceLengthMinutes)->calculateCredit()->decreaseCredit(); $this->storeMusicRecord( $fileUrl, $param, $request->get('workbook_title', 'Song Title'), $voiceLengthMinutes ); // --- DEMO MODE: RECORD USED TIME (AFTER GENERATION) --- if ($isDemo) { $clientIp = Helper::getRequestIp(); $cacheKey = "demo_ai_usage_seconds_{$clientIp}"; $usedSeconds = Cache::get($cacheKey, 0); $newTotal = $usedSeconds + ($voiceLengthMinutes * 60); // Convert minutes to seconds Cache::put($cacheKey, $newTotal, now()->endOfDay()); } $music = AiMusicPro::where('user_id', auth()->id())->orderBy('id', 'desc')->paginate(10); $html2 = view('ai-music-pro::components.generator_sidebar_table', compact('music'))->render(); return response()->json([ 'status' => 'success', 'message' => __('Music generated successfully!'), 'html2' => $html2, ]); } private function storeMusicRecord($fileUrl, $param, $title, $voiceLengthMinutes): void { $voiceLengthSeconds = null; if ($voiceLengthMinutes !== null) { $voiceLengthSeconds = $voiceLengthMinutes / 60; } elseif (! empty($param['music_length_ms'])) { $voiceLengthSeconds = $param['music_length_ms'] / 1000; } $data = [ 'user_id' => auth()->id(), 'file_path' => $fileUrl ?? null, 'workbook_title' => $title, 'ai_music_prompt' => $param['prompt'] ?? null, 'duration' => $voiceLengthSeconds, 'music_style' => $param['music_style'] ?? null, ]; AiMusicPro::create($data); } public function delete($id): RedirectResponse { $music = AiMusicPro::where('user_id', auth()->id())->where('id', $id)->firstOrFail(); try { if (file_exists(public_path('uploads/' . $music->file_path))) { @unlink(public_path('uploads/' . $music->file_path)); } $music->delete(); return redirect()->back()->with(['message' => __('Music deleted successfully!'), 'type' => 'success']); } catch (Exception $e) { return redirect()->back()->with(['message' => __('Failed to delete music. Please try again.'), 'type' => 'error']); } } } PK!GW]ëš©System/Http/Requests/.gitkeepnu„[µü¤* !.gitignore PK!GW]ëš©System/Http/Resources/.gitkeepnu„[µü¤* !.gitignore PK!GW]ÈãÍððresources/views/index.blade.phpnu„[µü¤@php $ai_music_options = [ 'duration' => [ '' => __('None'), '30' => '30 ' . __('seconds'), '60' => '1 ' . __('minute'), '120' => '2 ' . __('minutes'), '180' => '3 ' . __('minutes'), ], 'music_style' => [ '' => __('None'), 'techno' => 'Techno', 'lofi' => 'Lo-Fi', 'pop' => 'Pop', 'jazz' => 'Jazz', 'rock' => 'Rock', 'classical' => 'Classical', 'hiphop' => 'Hip-Hop/Trap', 'edm' => 'EDM/House', 'reggae' => 'Reggae', 'ambient' => 'Ambient', 'cozy' => 'Cozy', 'relaxed' => 'Relaxed', ] ]; @endphp @extends('panel.layout.app', ['disable_tblr' => true]) @section('title', __('AI Music Pro')) @section('titlebar_subtitle', __('Create music tracks with AI')) @section('content')

{{ __('Describe your song') }}
{{ __('Advanced Settings') }}
{{ __('Generate') }}
@include('ai-music-pro::components.generator_sidebar_table', ['music' => $music])
@endsection @push('script') @endpush PK!GW]fMØË""<resources/views/components/generator_sidebar_table.blade.phpnu„[µü¤ {{ __('File') }} {{ __('Info') }} {{ __('Play') }} {{ __('Action') }} @forelse ($music ?? [] as $song) {{ $song->workbook_title }} {{ $song->created_at->format('M d, Y') }} {{-- --}} {{-- {{$song->duration ?? 0}} {{ __('seconds') }}--}} {{-- --}}
0:00 @empty {{ __('No entries created yet.') }} @endforelse
{{ $music->links('pagination::bootstrap-5-alt') }}
PK!GW]5ˆÓ ))config/aimusicpro.phpnu„[µü¤ 1.0, ]; PK!GW]�L½‹££__MACOSX/._Systemnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/._resourcesnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££Q__MACOSX/database/migrations/._2025_09_08_072943_add_music_slug_to_free_items.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££N__MACOSX/database/migrations/._2025_09_08_072943_create_ai_music_pro_table.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/database/._migrationsnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/._databasenu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/._confignu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££'__MACOSX/System/Models/._AiMusicPro.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££/__MACOSX/System/._AiMusicProServiceProvider.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/System/._Httpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££;__MACOSX/System/Http/Controllers/._AiMusicProController.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££(__MACOSX/System/Http/Requests/._.gitkeepnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/System/Http/._Requestsnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££ __MACOSX/System/Http/._Resourcesnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££"__MACOSX/System/Http/._Controllersnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££)__MACOSX/System/Http/Resources/._.gitkeepnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/System/._Modelsnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££*__MACOSX/resources/views/._index.blade.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££G__MACOSX/resources/views/components/._generator_sidebar_table.blade.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££%__MACOSX/resources/views/._componentsnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/resources/._viewsnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££ __MACOSX/config/._aimusicpro.phpnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]�L½‹££__MACOSX/._extension.jsonnu„[µü¤Mac OS X  2q£ATTR£˜ ˜ com.apple.provenance¤`˜†TÜçPK!GW]¬8ÊýÜÜCdatabase/migrations/2025_09_08_072943_create_ai_music_pro_table.phpnu„[µü¤PK!GW]ËX²««FOdatabase/migrations/2025_09_08_072943_add_music_slug_to_free_items.phpnu„[µü¤PK!GW] ƒšL……pextension.jsonnu„[µü¤PK!GW]’ç‚g$3System/AiMusicProServiceProvider.phpnu„[µü¤PK!GW]dYD¦¦�System/Models/AiMusicPro.phpnu„[µü¤PK!GW]Y`0�System/Http/Controllers/AiMusicProController.phpnu„[µü¤PK!GW]ëš©ü/System/Http/Requests/.gitkeepnu„[µü¤PK!GW]ëš©W0System/Http/Resources/.gitkeepnu„[µü¤PK!GW]ÈãÍðð³0resources/views/index.blade.phpnu„[µü¤PK!GW]fMØË""<òOresources/views/components/generator_sidebar_table.blade.phpnu„[µü¤PK!GW]5ˆÓ ))€cconfig/aimusicpro.phpnu„[µü¤PK!GW]�L½‹££îc__MACOSX/._Systemnu„[µü¤PK!GW]�L½‹££Òd__MACOSX/._resourcesnu„[µü¤PK!GW]�L½‹££Q¹e__MACOSX/database/migrations/._2025_09_08_072943_add_music_slug_to_free_items.phpnu„[µü¤PK!GW]�L½‹££NÝf__MACOSX/database/migrations/._2025_09_08_072943_create_ai_music_pro_table.phpnu„[µü¤PK!GW]�L½‹££þg__MACOSX/database/._migrationsnu„[µü¤PK!GW]�L½‹££ïh__MACOSX/._databasenu„[µü¤PK!GW]�L½‹££Õi__MACOSX/._confignu„[µü¤PK!GW]�L½‹££'¹j__MACOSX/System/Models/._AiMusicPro.phpnu„[µü¤PK!GW]�L½‹££/³k__MACOSX/System/._AiMusicProServiceProvider.phpnu„[µü¤PK!GW]�L½‹££µl__MACOSX/System/._Httpnu„[µü¤PK!GW]�L½‹££;žm__MACOSX/System/Http/Controllers/._AiMusicProController.phpnu„[µü¤PK!GW]�L½‹££(¬n__MACOSX/System/Http/Requests/._.gitkeepnu„[µü¤PK!GW]�L½‹££§o__MACOSX/System/Http/._Requestsnu„[µü¤PK!GW]�L½‹££ ™p__MACOSX/System/Http/._Resourcesnu„[µü¤PK!GW]�L½‹££"Œq__MACOSX/System/Http/._Controllersnu„[µü¤PK!GW]�L½‹££)�r__MACOSX/System/Http/Resources/._.gitkeepnu„[µü¤PK!GW]�L½‹££}s__MACOSX/System/._Modelsnu„[µü¤PK!GW]�L½‹££*ht__MACOSX/resources/views/._index.blade.phpnu„[µü¤PK!GW]�L½‹££Geu__MACOSX/resources/views/components/._generator_sidebar_table.blade.phpnu„[µü¤PK!GW]�L½‹££%v__MACOSX/resources/views/._componentsnu„[µü¤PK!GW]�L½‹££ww__MACOSX/resources/._viewsnu„[µü¤PK!GW]�L½‹££ dx__MACOSX/config/._aimusicpro.phpnu„[µü¤PK!GW]�L½‹££Wy__MACOSX/._extension.jsonnu„[µü¤PK""’ Cz