s.spaan

s.spaan

Member Since 3 Years Ago

Experience Points
117,990
Total
Experience

2,010 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
1163
Lessons
Completed
Best Reply Awards
1
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 24
117,990 XP
Nov
05
2 weeks ago
Activity icon

Replied to Help Requested: SOAP Rechtspraak.nl

Oke, i do have it working; If someone still has a existing PHP Api for the bewindregister i would like to know.

For if someone is looking i used the following code:

$wsdl = 'https://sts.rechtspraak.nl/adfs/services/trust/mex';

$client = new SoapClient($wsdl, [
    'soap_version'       => SOAP_1_2,
    'exceptions'         => true,
    'trace'              => true,
    'cache_wsdl'         => WSDL_CACHE_NONE,
]);

$wrapper           = new stdClass();
$wrapper->Username = new SoapVar($username, XSD_STRING, null, null, null, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");
$wrapper->Password = new SoapVar($password, XSD_STRING, null, null, null, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");

$auth                = new stdClass();
$auth->UsernameToken = new SoapVar($wrapper, SOAP_ENC_OBJECT, null, null, null, "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd");

$headers = [
    new SoapHeader('http://www.w3.org/2005/08/addressing', 'Action', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue'),
    new SoapHeader('http://www.w3.org/2005/08/addressing', 'To', 'https://sts.rechtspraak.nl/adfs/services/trust/13/usernamemixed'),
    new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $auth),
];

$client->__setSoapHeaders($headers);

$EndpointReference          = new stdClass();
$EndpointReference->Address = new SoapVar('https://curateleenbewindregisterservice.rechtspraak.nl/', XSD_STRING, null, null, null, "http://www.w3.org/2005/08/addressing");

$AppliesTo                    = new stdClass();
$AppliesTo->EndpointReference = new SoapVar($EndpointReference, SOAP_ENC_OBJECT, null, null, null, "http://www.w3.org/2005/08/addressing");

$RSTRequest              = new stdClass();
$RSTRequest->AppliesTo   = new SoapVar($AppliesTo, SOAP_ENC_OBJECT, null, null, null, "http://schemas.xmlsoap.org/ws/2004/09/policy");
$RSTRequest->KeyType     = new SoapVar('http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer', XSD_STRING, null, null, null, "http://docs.oasis-open.org/ws-sx/ws-trust/200512");
$RSTRequest->RequestType = new SoapVar('http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue', XSD_STRING, null, null, null, "http://docs.oasis-open.org/ws-sx/ws-trust/200512");

$RequestSecurityToken = new SoapVar($RSTRequest, SOAP_ENC_OBJECT, null, null, null, "http://docs.oasis-open.org/ws-sx/ws-trust/200512");

$response = $client->__soapCall('Trust13IssueAsync', ['RequestSecurityToken' => $RequestSecurityToken], [
    'location' => 'https://sts.rechtspraak.nl/adfs/services/trust/13/usernamemixed'
]);

echo '<pre>';

var_dump('----------------------------- RESPONSE --------------------------------------');


var_dump($response);

exit;

If someone knows how to do this better i would like to know!

Activity icon

Started a new Conversation Help Requested: SOAP Rechtspraak.nl

Hi All,

I know it's not a Laravel specific question, but i'm having some trouble with a Soap connection to an endpoint. I do have it working in Postman, but can't seem to get it working in PHP.

When i do a POST to https://sts.rechtspraak.nl/adfs/services/trust/13/usernamemixed

With the following body:

<s:Envelope
    xmlns:s="http://www.w3.org/2003/05/soap-envelope"
    xmlns:a="http://www.w3.org/2005/08/addressing"
    xmlns:wsa="http://www.w3.org/2005/08/addressing"
    xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
    <s:Header>
        <a:Action>http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</a:Action>
        <a:To>https://sts.rechtspraak.nl/adfs/services/trust/13/usernamemixed</a:To>
        <o:Security>
            <o:UsernameToken>
                <o:Username>[USERNAME]</o:Username>
                <o:Password>[PASSWORD]</o:Password>
            </o:UsernameToken>
        </o:Security>
    </s:Header>
    <s:Body>
        <trust:RequestSecurityToken>
            <wsp:AppliesTo>
                <wsa:EndpointReference>
                    <wsa:Address>https://curateleenbewindregisterservice.rechtspraak.nl/</wsa:Address>
                </wsa:EndpointReference>
            </wsp:AppliesTo>
            <trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
            <trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
        </trust:RequestSecurityToken>
    </s:Body>
</s:Envelope>

It's working, but the following PHP does not:

$client = new SoapClient('https://sts.rechtspraak.nl/adfs/services/trust/mex', [
    'soap_version'  => SOAP_1_2,
]);


$auth     = [
    'UsernameToken' => [
        'Username' => $username,
        'Password' => $password,
    ]
];

$headers = [
    new SoapHeader('http://www.w3.org/2005/08/addressing', 'Action', 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue', true, 'a'),
    new SoapHeader('http://www.w3.org/2005/08/addressing', 'To', 'https://sts.rechtspraak.nl/adfs/services/trust/13/usernamemixed', true, 'a'),
    new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', $auth, true, 'o'),
];


$client->__setSoapHeaders($headers);

$response = $client->__soapCall('Trust13IssueAsync', [
    'RequestSecurityToken' => [
        'AppliesTo' => [
            'EndpointReference' => [
                'Address' => 'https://curateleenbewindregisterservice.rechtspraak.nl/'
            ]
        ]
    ],
    'KeyType'  => 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer',
    'RequestType' => 'http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue',
]); 

I get a timeout after 30 seconds

(when i use default SOAP_VERSION i get the error: Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'. so must be SOAP_1_2 ?)

I find it really weird that i don't get any errors but a timeout.

Anyone has any more experience with Soap on PHP and can help me to the next step? If i remove anything from the first XML it fails with an error in Postman. So maybe i need to use SoapVar/SoapParam but i already have spend a lot of time on the API, and hoping someone want to help me. Or maybe someone already created a PHP API for the bewindregister of rechtspraak.nl ?

WSDL is available at: https://sts.rechtspraak.nl/adfs/services/trust/mex

Any more documentation is at: https://www.rechtspraak.nl/Registers/Paginas/Webservice-Curatele-en-bewindregister-CCBR.aspx

Oct
14
1 month ago
Activity icon

Started a new Conversation Telescope Log Guzzle Outgoing Requests

Hi All,

Do any of you guys know of a package which can log all outgoing Guzzle requests to Telescope?

Or how can i create this myself? Is it possible to create a custom Watcher for telescope (i know i can create a Guzzle Handler stack which could log it, i have never done it however.).

Hope someone already have created the package, and i just can't find it.

Thanks!

Sonny

Jul
12
4 months ago
Activity icon

Replied to Redirection In Laravel

It's better to make a different topic for another question.

But anyway:

 $url ="https://api.stripe.com/v1/customers?limit=3";


$ch = curl_init(); //open connection
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer sk_test_xxxxxxx',
]);

$result_count = curl_exec($ch); //execute post

echo"<pre>";
print_r($result_count);
exit;

And it's better to not show the api token in the questions on the forum, even if it's the test token.

Activity icon

Replied to Redirection In Laravel

Sorry, missed that one.

Jul
09
4 months ago
Activity icon

Replied to Redirection In Laravel

Sorry, i didn't receive any notification of the replies. But i have changed it.

Activity icon

Replied to Test Artisan Command Called

@aurawindsurfing I can test if the command is executed, but i would like to do something like this:

/** @test */
public function command_was_called() 
{

Artisan::fake();

$this->post('/run-command', ['parameter' => 2]);

Artisan::assertIsCalled(SomeCommand::class);

}

Like we can do with the Queues ..

Activity icon

Started a new Conversation Test Artisan Command Called

Hi, i'm looking for a way to test is a artisan command was called from a controller.

I know how to test the command itself, but how to test that the command was executed.

Jul
05
4 months ago
Activity icon

Replied to Curl : Failed To Store Data In DB

Any routes defined in the api.php are prefixed with /api.

So i think your url should be (if http://localhost/myproject/public/index.php is actually working):

$url = 'http://localhost/myproject/public/index.php/api/postReqFromView';

But it's better to serve the project like @snapey suggested and use a URL like

$url = 'http://localhost:8080/api/postReqFromView';
Activity icon

Replied to Redirection In Laravel

You could also wrap them in a group:

Route::domain('payments.example.com')->group(function () {
    Route::get('/', function () { return 'welcome'; });
    Route::get('payment/{id}', '[email protected]');
    Route::post('paymentStripe', '[email protected]_payment');
    Route::get('paymentFails', '[email protected]');
});

Route::domain('www.example.com')->group(function () {
    // remaining routes declared here
});

maybe this will fix the issues?

Activity icon

Replied to How To Handle This?

If you need a collection of those values you could do:

$dataVencimento= collect($dados[0]->{'PARCELA-PAGA'})->pluck('DATA-VENCIMENTO');

dd($dataVencimento);
Activity icon

Replied to How To Handle This?

Try:

$firstRecord = collect($dados[0]->{'PARCELA-PAGA'})->firstWhere('DATA-VENCIMENTO', '20170818');

dd($firstRecord);
Activity icon

Replied to How To Handle This?

No, because ->first() would just give you the very first item in the collection.

What do you get when you dd the following:

dd(collect($dados[0]->{'PARCELA-PAGA'}));
Activity icon

Replied to How To Handle This?

$url = 'http://*.*.*.*/SomeServices.asmx?WSDL';
$idERP = 1;
$grupoEcota = new \SoapClient($url);
$paramExtrato = array(
    'sGrupo' => $request->sGrupo,
    'iCota' => $request->iCota,
    'iIdERP' => $idERP,
);
$responseExtrato = $grupoEcota->ROS_ExtratoContaCorrente($paramExtrato);
$grupoEcota = $responseExtrato->ExtratoContaCorrente;
$dados[] = $grupoEcota->{'PARCELAS-PAGAS'};

$firstRecord = collect($dados[0]->{'PARCELA-PAGA'})->firstWhere(['DATA-VENCIMENTO' => '20170818']);

dd($firstRecord);

Should be like this.

Jul
04
4 months ago
Activity icon

Replied to How To Handle This?

collect($dados[0]->{'PARCELA-PAGA'})->firstWhere(["DATA-VENCIMENTO" => "20170818"]); maybe like so?

Activity icon

Replied to How To Handle This?

collect($response)->firstWhere(["DATA-VENCIMENTO" => "20170818"]); should do the trick

Jul
01
4 months ago
Activity icon

Commented on Drop Down A Level

I'm wondering why you don't inline the getTeam in the controller? Any reason for that?