多🌹444收拾收拾计算机视觉手机手机手机手机4大尺寸惆怅长岑长
??????????????????????????С??????????????P??????????????????????????????????????????????????????^??????????
????j??????????
? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!extension.json 0000644 00000000207 15266620417 0007463 0 ustar 00 {
"name": "Influencer Avatar",
"type": "extension",
"version": "1.3.0",
"description": "Influencer Avatar extension for magicai"
}
System/InfluencerAvatarServiceProvider.php 0000644 00000004461 15266620417 0015044 0 ustar 00
*
* @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.
*/
class InfluencerAvatarServiceProvider extends ServiceProvider implements UninstallExtensionServiceProviderInterface
{
public function boot(Kernel $kernel): void
{
$this->registerViews()
->registerRoutes();
}
public function registerViews(): static
{
$this->loadViewsFrom([__DIR__ . '/../resources/views'], 'influencer-avatar');
return $this;
}
private function registerRoutes(): static
{
Route::group([
'middleware' => ['web', 'auth'],
], function () {
Route::group([
'prefix' => 'dashboard/user/influencer-avatar',
'as' => 'dashboard.user.influencer-avatar.',
], function () {
Route::get('', [InfluencerAvatarController::class, 'index'])->name('index');
Route::post('generate-short-video', [InfluencerAvatarController::class, 'generateShortVideo'])->name('generate-short-video');
Route::get('check-video-status/{request_id}', [InfluencerAvatarController::class, 'checkStatus'])->name('check-video-status');
Route::get('get-final-result/{request_id}', [InfluencerAvatarController::class, 'getFinalVideo'])->name('get-final-result');
});
});
return $this;
}
public static function uninstall(): void
{
// TODO: Implement uninstall() method.
}
}
System/Http/Controllers/InfluencerAvatarController.php 0000644 00000007033 15266620417 0017277 0 ustar 00 json([
'status' => 'error',
'message' => trans('This feature is disabled in demo mode.'),
]);
}
$validated = $request->validated();
$driver = Entity::driver(EntityEnum::VEED)->inputVideoCount(1)->calculateCredit();
$driver->redirectIfNoCreditBalance();
$driver->decreaseCredit();
try {
$service = new FalAIService(ApiHelper::setFalAIKey());
$res = $service->textToVideoModel(EntityEnum::VEED)->submit($validated);
$requestId = $res->getData()?->resData?->request_id;
if (! empty($requestId)) {
ExportedVideo::create([
'task_id' => $requestId,
'status' => VideoStatusEnum::IN_PROGRESS->value,
'used_ai_tool' => 'fal-ai',
]);
}
return $res;
} catch (Throwable $th) {
return $this->exceptionRes($th, 'Error happen while generate short video on ai-influcener');
}
}
// check status of generating video
public function checkStatus(string $requestId): JsonResponse
{
try {
$service = new FalAIService(ApiHelper::setFalAIKey());
return $service->textToVideoModel(EntityEnum::VEED)->checkStatus($requestId);
} catch (Throwable $th) {
return $this->exceptionRes($th, 'Error happen while checking status of generating video on ai-influcener');
}
}
// get final video
public function getFinalVideo(string $requestId): JsonResponse
{
try {
$service = new FalAIService(ApiHelper::setFalAIKey());
$resData = $service->textToVideoModel(EntityEnum::VEED)->getResult($requestId)->getData();
if ($resData->status === 'success') {
$videoResult = $resData->resData->video;
$video = ExportedVideo::where('task_id', $requestId)->first();
$video->update([
'video_url' => $videoResult->url,
'title' => 'Short Video',
'status' => VideoStatusEnum::COMPLETED->value,
]);
return response()->json([
'status' => 'success',
'resData' => $video,
]);
}
$video = ExportedVideo::where('task_id', $requestId)->update([
'status' => VideoStatusEnum::FAILED->value,
]);
throw new RuntimeException($resData->message ?? 'Unexpected issue happen');
} catch (Throwable $th) {
return $this->exceptionRes($th, 'Error happen while get final result on ai-influcener');
}
}
}
resources/views/social-video-window/social-video-window.blade.php 0000644 00000036005 15266620417 0021255 0 ustar 00 {{-- Edit Window --}}
{{-- --}}
{{ __('Generate captivating influencer video content for Reels, TikTok, and Shorts.') }}
{{ __('AI Influencer Avatars') }}
@lang('Generate captivating video content with influencers.')