pomocu

pomocu

Member Since 3 Years Ago

Experience Points 400
Experience Level 1

4,600 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

19 Dec
6 months ago

pomocu started a new conversation Laravel Forge's Configuration Of NGINX + SSL Causes Safari Timeout.

Hello guys,

There's an issue with the way Forge configures nginx after the installation of SSL (LetsEncrypt or or other), which causes the website to timeout ONLY on Safari (MacOS/Windows) as well as across all browsers on the iPhone. This issue happens in Iran when the VPN is off. Turning on the VPN resolves the issue.

The issue IS NOT present on any other browsers; chrome, FireFox, IE all load the site successfully without a VPN on MacOS, Windows, or Android devices.

I've tested the issue on several servers/domains deployed with Forge on DigitalOcean (Domains through GoDaddy).

I've discussed the issue with fellows at LetsEncrypt, but to no avail. They're under the impression that Forge's configuration of nginx is the main culprit. To make matters more complicated, some of the nginx config changes they suggested (e.g. a "ssl_ecdh_curve" directive to alter nginx's "named groups") were not being properly implemented through the nginx file of the Forge console.

I've been pulling my hair for the past few days trying to fix this issue, but no luck so far.

Again, this issue is certainly country specific, though I'm not aware of any other countries aside from Iran where it might be happening.

Any ideas on how to fix it or where to seek assistance?

18 Dec
6 months ago

pomocu started a new conversation LetsEncrypt Installed Through Forge Causes Timeout On Safari

Hi guys,

I'm wondering if the Forge engineers are aware that, in Iran, when the VPN is off, LetsEncrypt certificates installed through the Laravel Forge console cause the url to timeout on Safari and across all browsers installed on the iPhone. IE and Non-iPhone Chrome and FireFox can successfully load the page, however.

I've been discussing the issue with the support team at LetsEncrypt for the past couple of days, but to no avail. Details can be seen on this thread:

https://community.letsencrypt.org/t/accessing-letsencrypt-ssl-sites-from-iran-through-apple-devices/80172/79

But we hit a stone wall because they weren't Forge's management of nginx made it kind of impossible for me to implement some of the changes they were expecting.

Any assistance regarding this issue is greatly appreciated.

17 Dec
6 months ago

pomocu left a reply on LetsEncrypt Installed Through Laravel Forge Causes Safari/iPhone Timeout From Iran

@AURAWINDSURFING - Hello @aurawindsurfing,

Apologies for my delayed response. I was playing around with the server/config so it was probably down at the time of your testing. It should be back up now and you should see the info.php.

16 Dec
6 months ago

pomocu started a new conversation LetsEncrypt / Laravel Forge / Safari/iPhone Timeout From Iran

Hello all,

So here’s a challenging problem:

I have a "test" domain (filmdoost.com) through GoDaddy and a server on DigitalOcean (nginx 1.15.5) that I’ve deployed through Laravel Forge (LF). I’ve also used LF to add a LetsEncrypt (LE) certificate to the domain.

Everything works great prior to installing the LE certificate.

Here’s what happens when trying to access the site from Iran AFTER adding the LE certificate:

Everything is fine through:

Chrome, Firefox, IE browsers on MacOS/Windows
Chrome, Firefox on Android devices
Android app that hits the same server/domain

The site can ONLY BE ACCESSED WITH A VPN through:

Safari browser on MacOS/Windows
all browsers on the iPhone (iOS 11/12)
iOS app that hits the same server/domain

In other words, Apple related browsers/apps can only connect to the server through a VPN. The connection times out without a VPN.

Now if this were a sanctions related issue, then I’d expect to see the same problem across all devices/browsers. But the fact that this issue only arises with Apple related apps/browsers leads me to believe that the issue is config related. In other words, there is something about the server config applied by Forge after installing the certificate that Apple doesn’t like when trying to access the server from Iranian ISPs.

I've been talking to the LetsEncrypt support team, but to no avail so far. But I do know that the issue isn't related to the LE certificate itself because I can access sites with LE certificates that were not installed through the Forge panel.

I found what turned out to be a temporary fix for the iPhone app (creating default instead of shared nsurlsessions), but even that stopped working a couple of days ago. Here's the error that's thrown by the iPhone app:

Error Domain=NSURLErrorDomain Code=-1001 “The request timed out.” UserInfo={NSUnderlyingError=0x2816058c0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 “(null)” UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=https://filmdoost.com//, NSErrorFailingURLKey=https://filmdoost.com//, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}

Any assistance in helping resolve this issue is greatly appreciated. My iOS users are dropping like flies since they can’t run the app without a VPN.

Here’s a copy of my Nginx config file:

FORGE CONFIG (DO NOT REMOVE!)

include forge-conf/filmdoost.com/before/*;

server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name filmdoost.com; root /home/forge/filmdoost.com/public;

# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/filmdoost.com/460227/server.crt;
ssl_certificate_key /etc/nginx/ssl/filmdoost.com/460227/server.key;

ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparams.pem;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

index index.html index.htm index.php;

charset utf-8;

# FORGE CONFIG (DO NOT REMOVE!)
include forge-conf/filmdoost.com/server/*;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

access_log off;
error_log  /var/log/nginx/filmdoost.com-error.log error;

error_page 404 /index.php;

location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
}

location ~ /\.(?!well-known).* {
    deny all;
}

}

FORGE CONFIG (DO NOT REMOVE!)

include forge-conf/filmdoost.com/after/*;

22 Jun
3 years ago

pomocu started a new conversation Homestead Installation

Hi,

Trying a fresh installation Laravel on my Mac. What is supposed to be a straight forward process is turning out to be a bit cumbersome.

I've already installed Composer, Vagrant, and VirtualBox. However, apparently due to my slow connection, my attempts to download Homestead via the "vagrant box add laravel/homsetead" command keep failing with the following error:

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

transfer closed with 592071542 bytes remaining to read

I tried to directly download the file from:

https://vagrantcloud.com/laravel/boxes/homestead/versions/0.4.4/providers/virtualbox.box

I chose version 0.4.4, which is supposed to be the latest. The downloaded file is just over 1GB in size and is called "hc-download" without an extension. So I tried the following command in my terminal:

vagrant box add laravel/homestead ~/downloads/hc-download
``
The result:

==> box: Box file was not detected as metadata. Adding it directly... ==> box: Adding box 'laravel/homestead' (v0) for provider: box: Unpacking necessary files from: file:///Users/pouryamoaphi/downloads/hc-download.box The box failed to unpackage properly. Please verify that the box file you're trying to add is not corrupted and try again. The output from attempting to unpackage (if any):

x ./box-disk1.vmdk: truncated gzip input bsdtar: Error exit delayed from previous errors.

Any guidance about how to resolve this issue would be much appreciated. 
03 May
3 years ago

pomocu left a reply on Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

    $theaters = DB::select("select t.name, s.showtimes
                                from 
                                theaters t, showtimes s, films f
                                where
                                t.city = ?
                                and
                                t.id = s.theater_id
                                and
                                s.film_id = f.id
                                and
                                f.id = ?", [$city, $filmId]);

pomocu left a reply on Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

Thanks for your answere, @d3xt3r and @Snapey ! I went ahead went ahead with a raw sql query

'''

    $theaters = DB::select("select t.name, s.showtimes
                                from 
                                theaters t, showtimes s, films f
                                where
                                t.city = ?
                                and
                                t.id = s.theater_id
                                and
                                s.film_id = f.id
                                and
                                f.id = ?", [$city, $filmId]);

''' I suppose this would be the simplest way to get what I want?

pomocu left a reply on Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

Thanks again, Snapey! My bad on not changing theatre to theater in my code.

The new code does retrieve all the theaters with the chosen "cityName", which is the problem that I've been struggling with all along. I'm trying to retrieve only those theaters that are associated with the selected film_id through the showtimes table.

Also, I've come across that "use($variable)" statement on a few forums, but haven't really been able to figure out what it means. Could you be kind enough to give me a quick explanation, or direct me to a link that explains it?

Many thanks!

pomocu left a reply on Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

function test() {
  console.log("notice the blank line before this function?");
}

pomocu left a reply on Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

Thanks for your response, Snapey!

Your query gives me the following fatalErrorException: local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'App\Http\Controllers\Theatres' not found'

Here are my Models:

class Film extends Model { public function theaters() { return $this->belongsToMany(Theater::class, 'showtimes')->withPivot('showtimes'); } }

class Theater extends Model { public function films() { return $this->belongsToMany(Film::class, 'showtimes')->withPivot('showtimes'); } }

I don't have a model for "showtimes". Wouldn't the "::with('showtimes')" part of your query require a model for the "showtimes" table? I was under the impression that there is no need for a model for an intermediate table that joins two related tables with a many-to-many relationship? Or am I missing something?

pomocu started a new conversation Eager Loading Many-to-many Relationships With Constraints In Laravel 5.2.

I have a "theaters" table and a "films" table with a many-to-many relationship. The intermediate table is called "showtimes" with "film_id" and "theater_id" as foreign keys and a "showtimes" COLUMN.

I'm trying to eager load (if possible) the following raw query with eloquent:

SELECT t.name, s.showtimes FROM theaters t, films f, showtime s WHERE t.city = 'someCity' AND t.id = s.theater_id AND s.film_id = f.id AND f.id = someFilmId

What would the eloquent query look like in Laravel 5.2, even if it's not possible to eager load the results.

Any guidance would be much appreciated. :)