Loriko

Loriko

Member Since 4 Years Ago

Experience Points 825
Experience Level 1

4,175 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.

05 Jul
3 years ago

Loriko left a reply on Access Denied For [email protected]

Could it be the DNS settings? Both sites are pointing to the same ip-address.

Loriko left a reply on Access Denied For [email protected]

Yes, pasted the ip-address that is visible in forge next to the servername. And even tried to just paste the ip-address hardcoded in the project where the env is being called. But also no success

Loriko started a new conversation Access Denied For [email protected]

I have multiple sites running on a server.

And i just switched a site from an other server to that server. But now i keep getting the error "Access denied for user 'me@examplesite.com'"

It's connecting to one of the other sites on the server, and i have really no clue why.

My DB host connection is set to the ip-address of the server. Am i missing something that i should change or... ?

03 Jul
3 years ago

Loriko left a reply on Pivot Table Problem

i did some digging, and this is what i have so far:

Page::with(['languages' => function($q) use($language_id, $slug) {
                        $q->where('language_id', $language_id);
                        $q->wherePivot('slug', $slug);
                    }])
                    ->first();

Though the output of this is the first record of the page table. (instead of the the one that it should return) And SQL generates this: "select * from pages", as if it ignores everything inside the with?

Loriko left a reply on Pivot Table Problem

Alright, good to know i've been using it wrong. Thank you :) I'll fix it when i have more time.

Though, do you know a way to make it work this way?

Loriko started a new conversation Pivot Table Problem

Hi, i'm not sure how to explain my problem but i'll give it a try.

I have 3 tables pages, languages and language_page.

This is what my models look like: Page model:

    {
        return $this->belongsToMany('App\Language', 'language_page')
                    ->withPivot('title', 'content', 'slug', 'meta_title', 'meta_description')
                    ->orderBy('main', 'desc');
    }

Language Model:

    public function pages()
    {
        return $this->belongsToMany('App\Page')
                    ->withPivot('title', 'content', 'slug', 'meta_title', 'meta_description');
    }

What i want to do return a record from the page table where language_id is a certain id, and where slug is a certain text.

This is what i got so far:

Page::whereHas('languages', function($q) use ($language_id) {
                        $q->where('language_id', $language_id);
                    })
                    ->get();

My problem: how can i add a where clause with the column slug (from the pivot table language_page) ?

i hope this makes any sense at all..

31 May
4 years ago

Loriko left a reply on Sending/receiving Mail With Forge/digital Ocean

@semgov if you haven't figured it out yet, i found the solution to my problem. I had to change the DNS settings in digitalocean. And i needed to point the nameservers from my domainname registration company to the ones that match digital ocean. How you can do that can you find here: https://www.digitalocean.com/community/tutorials/how-to-point-to-digitalocean-nameservers-from-common-domain-registrars

Good luck and let me know if it helped you!

Loriko started a new conversation Sending/receiving Mail With Forge/digital Ocean

Hey all,

Im using forge + digital ocean, im trying to send and receive mail with my Laravel application. The way im trying to get this done is using the main mail server from my domain name registering company. They have SMTP settings that i used inside mail.php.

'driver' => 'smtp',
'host' => 'mail.axc.nl',
'port' => 465,
'from' => array('address' => 'info@example.com', 'name' => 'My Name'),
'encryption' => '',
'username' => 'info@example.com',
'password' => 'mypassword',

However im getting the error : Expected response code 250 but got code "", with message ""

Does anyone have a suggestion how i could fix this? Or another way to achieve sending/receiving mail through smtp.

26 May
4 years ago

Loriko left a reply on Connect To Forge Server & Upload Files To It

@bashy @codeatbusiness

I have solved the timeout, now im getting the following error: Unable to connect to remote server.

The public key is added to the ~/.ssh/authorized_keys. However how do i add the key to the remote host?

Maybe if i can solve that i can get my connection working :)

25 May
4 years ago

Loriko left a reply on Connect To Forge Server & Upload Files To It

@bashy @codeatbusiness i'll try both options tomorrow, right now not at the pc, thank you guys

Loriko left a reply on Connect To Forge Server & Upload Files To It

First question: My active firewall rules are: port 80 for http and port 443 for https

Second question: Yes i can manualy ssh into my application with the terminal.

Loriko left a reply on Connect To Forge Server & Upload Files To It

@bashy i did replace host with the url of my application for example "laracast.com", not example.com.

Loriko started a new conversation Connect To Forge Server & Upload Files To It

I'm new to using forge, and i was wondering how i can connect to one of my servers (SFTP + SSH) in laravel 5.

My endgoal is to upload files to another server.

What i have so far:

Config::set('remote.connections.tenant.server', 'my stuff here');
Config::set('remote.connections.tenant.port', 'my stuff here');
Config::set('remote.connections.tenant.host', 'my stuff here');
Config::set('remote.connections.tenant.user', 'my stuff here');
Config::set('remote.connections.tenant.pass', 'my stuff here');

SSH::into('tenant')->put($localFile, $remotePath);

I get this error: "Cannot connect to example.com:22. Error 110. Connection timed out"

Am i going in the right direction, or is this completely wrong? Help would be very much appreciated, thanks!

23 Apr
4 years ago

Loriko started a new conversation Page Closuretable Without Package

I would like to create a closure table without using a package. I'm not quite sure how to get this up correctly.

In my database table i would have a id, parent_id and a depth column (i think).

But what is a good way to use this combined with eloquent for storing a new page or update/deleting a existing one?

Is this also a good practice to build a tree? (child pages etc.) If so, what are your thoughts on how i can achieve this?

03 Apr
4 years ago

Loriko started a new conversation Validator Error: Unresolvable Dependency Resolving

I'm having a issue with validation (atleast i believe it's the validation), after submitting a form with ajax to my controller i get the following error:

BindingResolutionException in Container.php line 872: Unresolvable dependency resolving [Parameter #1 [ array $data ]] in class Illuminate\Validation\Validator

in combination with this error: Uncaught TypeError: Cannot read property 'length' of undefined

This is what my ajax looks like:

$(".productForm").submit(function(e) {
    var form = $(this);
    var method = form.find('input[name="_method"]').val() || 'POST';
    var url = 'contact-product';

    $.ajax({
        type: method,
        url: url,
        dataType: 'json',
        data: form.serialize(),
        success: function () {
            //dostuff
        },
        error: function(errors) {
            $.each(errors.responseJSON, function(index, error) {
                $('.error-messages').append('<li class="error-msg"><i class="fa fa-exclamation-triangle"></i> ' + error + '</li>');
            });
        }
    });
    e.preventDefault();
});             

My Controller:

<?php namespace App\Http\Controllers;

use App\Http\Requests;
use Redirect;
use App\Http\Requests\ProductFormRequest;
use Illuminate\Validation\Validator;

class ContactController extends Controller {

public function contactProduct(ProductFormRequest $request, Validator $validator)
{
    if (!strlen($request->input('custom'))) {

        if ($validator->passes()) {
            \Mail::send('emails.order',
                $data = [
                    'firstname' => $request->get('firstname'),
                    'lastname'  => $request->get('lastname'),
                    'email'     => $request->get('email'),
                ], function ($message) use ($request) {
                    $message->from($request->get('email'));
                    $message->to('info@example.nl', 'example')
                            ->subject('example');
            });

            return $status = json_encode('success');
        }

        return $errors = json_encode($validator->errors()->all());
    }
}
}

My Request file:

<?php namespace App\Http\Requests;

use App\Http\Requests\Request;

class ProductFormRequest extends Request {

public function authorize()
{
    return true;
}


public function rules()
{
    return [
        'firstname' => 'required',
        'lastname'  => 'required',
        'email'     => 'required|email'
    ];
}

}

I've been trying alot, but can't figure out what is wrong. So any help would be very much appreciated!