Has anyone here used js-emoji lib?
How to get articles and last 3 comments of each article?
where is the problem?
do you create database shopping?
Can anyone help me with this ?
And could you provide docker build output?
If you take away the limit, does it work?
https://github.com/iamcal/js-emoji/issues/129
I’m trying to use App’s emojis, but when I set use_sheet true, emojis disappear. This is my code. emoji.img_set = ‘apple’; emoji.img_sets.apple.sheet = ‘http…
Assume that
We have blog
Many articles
Each articles has many comments
How to get articles and last 3 comments of each article?
Something like this :
Article::latest()->with(‘last3_articles’)
Article::with(‘OnlyLast3CommentsOrderByNewer’)->get()
If you want.
Article::with(‘OnlyLast3CommentsOrderByNewer’)->get()
If you want.
I know what do you say but not working
comment in my app is a morph relation
so this is
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->take(5)->get();
not working
comment in my app is a morph relation
so this is
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->take(5)->get();
not working
production.ERROR: Method addEagerConstraints does not exist. {“userId”:27,”email”:”a@gmail.com”,”exception”:”[object] (BadMethodCallException(code: 0): Method addEagerConstraints does not exist.
ok check it
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->offset(0)->limit(5);
????
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->limit(3);
thanks 🥰🌺🌺🌺🌺👌🏻🤝🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
Sync will attach something, I will remove a record from pivot table
Done with detach()
chema.tables where table_schema = shopping and table_name = migrations and table_type = ‘BASE TABLE’)
this relation
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->limit(3);
work only for first article , for others return null;
i have 4 article
all of them more than 3 comments
this query only return for first article
if i delete article with id=1 ,, then return 3 comments for article with id =2 😐
chema.tables where table_schema = shopping and table_name = migrations and table_type = ‘BASE TABLE’)
do you create database shopping?!
I am new to docker, I am trying to containerize my existing lumen app. But I have an issue, I am not albe to install dependency using composer. Here is my dockerfile. Can anyone help me with this ?
# Base Image
FROM php:7.3-apache
# Update base image and install required modules
RUN apt-get update && apt-get install -y
libzip-dev
libbz2-dev
libjpeg62-turbo-dev
libpng-dev
libfreetype6-dev
zip
unzip
&& rm -r /var/lib/apt/lists/*
&& docker-php-ext-configure pdo_mysql –with-pdo-mysql=mysqlnd
# Install required extensions
RUN docker-php-ext-install mbstring tokenizer mysqli pdo_mysql gd
# Enable rewrite mod
RUN a2enmod rewrite
# Install composer
RUN curl -sS https://getcomposer.org/installer | php — –install-dir=/usr/local/bin –filename=composer
# Set working directory
WORKDIR /var/www/html
# Copy application contents
COPY . .
# Install dependency
RUN composer install
# Expose port 80
EXPOSE 80
# Start application
CMD bash -c “php -S 0.0.0.0:8000 -t public”
You have strange copy statement here
And could you provide docker build output?
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@ihs.tolosaadat.org to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at ts.edu.af Port 8
You have to look in server logs, in admin panel of your hosting
Error tells you that there is no table in your database
Make sure you are connecting to right database
Or restore this table from your db backup archive
this relation
return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘desc’)->limit(3);
work only for first article , for others return null;
i have 4 article
all of them more than 3 comments
this query only return for first article
if i delete article with id=1 ,, then return 3 comments for article with id =2 😐
If you take away the limit, does it work?
And could you provide docker build output?
Actually docker build is successful, y didn’t get any error during build
And could you provide docker build output?
But when I am trying to access the app in browser it gives me error regarding missing vendor
I don’t understand, what suggest to do?
I know that if I remove limit it’s work
But it’s not my answer
Think about for one article we have 25000 comments, but in this situation I only need 3 last comments
But it’s not my answer
Think about for one article we have 25000 comments, but in this situation I only need 3 last comments
In Instagram when you see a post
You only see a few comments , for each post
Is pretty safe to say is the limit that make that error, but better safe than sorry.
Im talking about output, not errors or exceptions
Is pretty safe to say is the limit that make that error, but better safe than sorry.
in the case we have 3k comments
what’s the difference between
this return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘asc’)->limit(3);
and this return $this->morphMany(Reply::class ,’repliable’ )->orderBy(‘id’, ‘asc’)
i don’t want only solve problem , I want to find best solution