在Laravel应用中,我试图实现一种结构,在该结构中,获取具有一个或多个用户可以访问的标签的帖子。我写了下面的代码来做到这一点:
ffmpeg -loop 1 -t 1 -i img1.jpeg -loop 1 -t 1 -i img2.jpeg -loop 1 -t 1 -i img3.jpeg
-loop 1 -t 1 -i img4.jpeg -filter_complex "
[0:v]scale=640:480:force_original_aspect_ratio=decrease, pad=640:480:(ow-iw)/2:(oh-ih)/2[v0];
[1:v]scale=640:480:force_original_aspect_ratio=decrease, pad=640:480:(ow-iw)/2:(oh-ih)/2[v1];
[2:v]scale=640:480:force_original_aspect_ratio=decrease, pad=640:480:(ow-iw)/2:(oh-ih)/2[v2];
[3:v]scale=640:480:force_original_aspect_ratio=decrease, pad=640:480:(ow-iw)/2:(oh-ih)/2[v3];
[v0][v1][v2][v3]concat=n=4" output.gif
这有效,但感觉不佳。所以我想知道是否有更好的方法可以做到这一点?
答案 0 :(得分:0)
@ user4992124,这对您有帮助吗?
$query = Posts::query()
->where('isTemplate', true)
->orderBy($key, $order);
if (Auth::user()->tags->isNotEmpty()) {
$tags = Auth::user()
->tags
->pluck('title')
->toArray();
$query = $query->whereIn('tags', $tags);
}
$posts = $query->paginate(15);