msiri

msiri

Member Since 6 Months Ago

Experience Points
320
Total
Experience

4,680 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
320 XP
Jun
18
4 months ago
Activity icon

Started a new Conversation Default Laravel Notification --> Data Is Not Working

Hi there. I'm trying to use default Laravel notification, but i don't understand why it's not showing the data.

/notification/NewReply.php

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class NewReply extends Notification
{
    use Queueable;

    public $user;
    public $association;
    public $opportunity;

    public function __construct($user, $association, $opportunity)
    {
      $this->user = $user;
      $this->opportunity = $opportunity;
      $this->association = $association;
    }

    public function via($notifiable)
    {
        return ['database'];
    }

    public function toDatabase($notifiable)
    {
        return [
          'user_id' => $this->user->id,
          'association_name' => $this->association->association_name,
          'opportunity_id' => $this->opportunity->id,
          'opportunity_name' => $this->opportunity->title,
        ];
    }
}

This is how i trigger the notification

$company->notify(new NewReply(Auth::user(),$association,$opportunity));

This is the data field saved after triggering, that is correct

{"user_id":2,"association_name":"Super delter","opportunity_id":1,"opportunity_name":"Afro tenders"}

i'll echo like this, as the documentation

@foreach(Auth::user()->notifications as $notification)
<p>{{$notification->data['association_name']}}</p>
@endforeach

But i get nothing... anyone have an idea?

Jun
13
4 months ago
Activity icon

Started a new Conversation 403 Forbidden After Install Namecheap’s PositiveSSL

Hello! After installing SSL certificate with Namecheap’s PositiveSSL on my server i’m getting 403 forbidden error page. I’m developing a Laravel app on a Nginx host (in http does work).

here’s my /etc/nginx/sites-enabled/ssl.conf

server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/sites-available/nginx_bundle_guida_deltipo.crt;
ssl_certificate_key /root/azas.social.key;


server_name  azas.social;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {

root /var/www/visibilio/visibilio/public;
index index.html;
}

}

And the following is nginx.conf file:


  GNU nano 2.9.3                                                                              /etc/nginx/nginx.conf                                                                                         



        ##

        # SSL Settings

        ##

        client_max_body_size 1000m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE

        ssl_prefer_server_ciphers on;



        ##

        # Logging Settings

        ##



        access_log /var/log/nginx/access.log;

        error_log /var/log/nginx/error.log;



        ##

        # Gzip Settings

        ##



        gzip on;



        # gzip_vary on;

        # gzip_proxied any;

        # gzip_comp_level 6;

        # gzip_buffers 16 8k;

        # gzip_http_version 1.1;

        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;



        ##

        # Virtual Host Configs

        ##



        include /etc/nginx/conf.d/*.conf;

        include /etc/nginx/sites-enabled/*;

}





#mail {

#       # See sample authentication script at:

#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript

# 

#       # auth_http localhost/auth.php;

#       # pop3_capabilities "TOP" "USER";

#       # imap_capabilities "IMAP4rev1" "UIDPLUS";

# 

#       server {

#               listen     localhost:110;

#               protocol   pop3;

#               proxy      on;

#       }

# 

#       server {

#               listen     localhost:143;

#               protocol   imap;

#               proxy      on;

#       }

#}

I ran out of ideas on how to solve it, please help :)

Jun
07
4 months ago
Activity icon

Replied to Create An Up To Date Feed

@MUSHOOD - This work bro, thank you very much!

Activity icon

Replied to Create An Up To Date Feed

@MUSHOOD - Same problem dear, Reply items it's lost

Activity icon

Replied to Create An Up To Date Feed

@MUSHOOD - This is working fine bro! But there’s a problem, in the second merge i lost the $newsReply element…

See this

$merged = $newsReply->merge($newsOpportunity);
dd($merged);
$merged = $merged->merge($newsComment);

This it’s what i get

Collection {#515 ▼
  #items: array:4 [▼
    0 => Reply {#678 ▶}
    1 => Reply {#679 ▶}
    2 => Opportunity {#714 ▶}
    3 => Opportunity {#715 ▶}
  ]
}

But with this

$merged = $newsReply->merge($newsOpportunity);
$merged = $merged->merge($newsComment);
dd($merged);

I lost Reply items

Collection {#514 ▼
  #items: array:4 [▼
    0 => Comment {#750 ▶}
    1 => Comment {#751 ▶}
    2 => Opportunity {#714 ▶}
    3 => Opportunity {#715 ▶}
  ]
}

I try this instead but not working…

$merged =  $newsReply>merge([$newsOpportunity,newsComment]);
$merged->all();

Any suggestions?

Jun
06
4 months ago
Activity icon

Replied to Create An Up To Date Feed

@MUSHOOD - Unfortunately I'm stuck here, I don't know how to compare all the data of the array and then reorder it by most recent date. If you have any suggestions please, share with me!

Activity icon

Replied to Create An Up To Date Feed

@MUSHOOD - I've checked it, but it's the same as

Reply::orderBy('id', 'desc')->take(3)->get();
Activity icon

Started a new Conversation Create An Up To Date Feed

Hi everyone, i've a 3 entities called Opportunity, Reply and Comments. I would like to order every item by the created_at attribute (last created first).

For this i've created 3 different query

$newsReply = Reply::orderBy('id', 'desc')->take(3)->get();
$newsOpportunity = Opportunity::orderBy('id', 'desc')->take(3)->get();
$newsComment = Comment::orderBy('id', 'desc')->take(3)->get();

And then i put it into an array, so the result is like this

array:3 [▼
  0 => Collection {#676 ▼
    #items: array:3 [▼
      0 => Reply {#677 ▼
        #fillable: array:15 [▼
          0 => "opportunity_id"
          1 => "association_id"
          2 => "media_name"
          3 => "title"
          4 => "description"
          5 => "changing_number"
          6 => "like"
          7 => "winner"
          8 => "coherence"
          9 => "creativity"
          10 => "clarity"
          11 => "personal"
          12 => "average"
          13 => "cover"
          14 => "declined"
        ]
        #connection: "mysql"
        #table: "replies"
        #primaryKey: "id"
        #keyType: "int"
        +incrementing: true
        #with: []
        #withCount: []
        #perPage: 15
        +exists: true
        +wasRecentlyCreated: false
        #attributes: array:17 [▼
          "id" => 4
          "opportunity_id" => 2
          "association_id" => 1
          "title" => "dwfnkjwenf"
          "description" => "aa"
          "changing_number" => 0
          "winner" => 0
          "coherence" => 0.0
          "creativity" => 0.0
          "clarity" => 0.0
          "personal" => 0.0
          "average" => 0.0
          "cover" => "1559037254.jpg"
          "document_file" => null
          "created_at" => "2019-05-28 11:54:14"
          "updated_at" => "2019-05-29 09:33:15"
          "declined" => 0
        ]
        #original: array:17 [▶]
        #changes: []
        #casts: []
        #dates: []
        #dateFormat: null
        #appends: []
        #dispatchesEvents: []
        #observables: []
        #relations: []
        #touches: []
        +timestamps: true
        #hidden: []
        #visible: []
        #guarded: array:1 [▶]
      }
      1 => Reply {#678 ▶}
      2 => Reply {#679 ▶}
    ]
  }
  1 => Collection {#713 ▼
    #items: array:3 [▼
      0 => Opportunity {#714 ▶}
      1 => Opportunity {#715 ▶}
      2 => Opportunity {#716 ▶}
    ]
  }
  2 => Collection {#750 ▼
    #items: array:3 [▼
      0 => Comment {#751 ▶}
      1 => Comment {#752 ▶}
      2 => Comment {#753 ▶}
    ]
  }
]

Or if you have an easier way to do so it's welcome

May
26
4 months ago
Activity icon

Replied to Retrieve Relationships Get Null Value

@BOBBYBOUWMANN - Thanks for your help, I tried the provided code but it gives me this error

Symfony\Component\Debug\Exception\FatalThrowableError thrown with message "Call to undefined function Invisibili\Http\Controllers\findOrFail()"
May
25
4 months ago
Activity icon

Replied to Retrieve Relationships Get Null Value

@BOBBYBOUWMANN - Now it's published! 😇

Activity icon

Started a new Conversation Retrieve Relationships Get Null Value

Hi there! I'm trying to load inside opportunity controller, my replies relative of a specific opportunity and also the association that writes them but i get a null value

  #relations: array:1 [▼
        "association" => null
      ]

This is my controller

public function show($id)
{

$opportunity = Opportunity::findOrFail($id);

$replies = Reply::where('opportunity_id', $opportunity->id)->with('association')->get();

return view('opportunity.show', compact('opportunity', 'replies'));

}

This is my opportunity.php

public function reply()
    {
        return $this->hasMany('Invisibili\Reply');
    }

My reply.php

  public function opportunity()
    {
        return $this->belongsTo('Invisibili\Opportunity');
    }

    public function association()
    {
        return $this->belongsTo('Invisibili\Association');
    }

and my association.php

    public function reply()
    {
        return $this->hasMany('Invisibili\Reply');
    }

Thanks for helping me!