screwtape_mk

Experience

560

0 Best Reply Awards

  • Member Since 5 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

8th October, 2018

screwtape_mk left a reply on Object Of Class StdClass Could Not Be Converted To String • 6 days ago

Wow that was the issue! Thank you very much - works like a charm now

screwtape_mk left a reply on Cannot Use Object Of Type StdClass As Array • 6 days ago

Thanks this worked but i now have issues inserting this data into a table. I have posted a seperate Question here:

https://laracasts.com/discuss/channels/laravel/object-of-class-stdclass-could-not-be-converted-to-string-3

screwtape_mk started a new conversation Object Of Class StdClass Could Not Be Converted To String • 6 days ago

I have this snippet of code:

foreach ($data as $p_data) 
            {
            
                    $payments_data[] = 
            
                        [
                            'id'=>$p_data->id,
                            'status'=>$p_data->status,
                            'date'=>$p_data->date,
                            'totalAmount'=>$p_data->totalAmount,
                            'settleAmount'=>$p_data->settleAmount,
                            'tipAmount'=>$p_data->tipAmount,
                            'snapCode'=>$p_data->snapCode,
                
                            'userReference'=>$p_data->userReference,
                            'statementReference'=>$p_data->statementReference,
                            'extra'=>$p_data->extra,
                            'address1'=>$p_data->deliveryAddress,
                            'requiredAmount'=>$p_data->requiredAmount,
                            'merchantReference'=>$p_data->merchantReference,
                            'authCode'=>$p_data->authCode,
                 
                 
                            
                 
                        ];
                        
                        Payments::insert($payments_data);
            }        

The first iteration is inserted and then it fails and give this error

I get the error:

Object of class stdClass could not be converted to string

3rd October, 2018

screwtape_mk left a reply on Cannot Use Object Of Type StdClass As Array • 1 week ago

array:50 [▼ 0 => {#203 ▼ +"id": 52 +"status": "completed" +"totalAmount": 22000 +"tipAmount": 0 +"feeAmount": 759 +"settleAmount": 21241 +"requiredAmount": null +"date": "2018-07-29T13:07:22Z"

screwtape_mk started a new conversation Cannot Use Object Of Type StdClass As Array • 1 week ago

I have an array of the type :

$data=

array:50 [▼ 0 => {#203 ▼ +"id": 52 +"status": "completed" +"totalAmount": 22000 +"tipAmount": 0 +"feeAmount": 759 +"settleAmount": 21241 +"requiredAmount": null +"date": "2018-07-29T13:07:22Z"

I am not sure how to reference it. When it do this $data['0']['id'] I get an error: Cannot use object of type stdClass as array

How do i reference this

25th September, 2018

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User • 2 weeks ago

I will go for 2 functions - one for general public which will require a captcha verification and another for logged in users.

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User • 2 weeks ago

i suspect the captcha verification in the second form since isnt showing is therefore not clicked and as a result the second form returns nothing. Can I apply the :

@if(!Auth::check())

inside the controller so that captcha verification is applied only to not logged in users?

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User • 2 weeks ago

How do you mean by 'search functions'

Why do you name your fields with array brackets?

  • The form has an autocomplete search functionality

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User • 2 weeks ago

The search Controller is :

class SearchController extends Controller {

public function getResults(Request $request)
{

    $query1=implode("",$request->input('EmpService'));
    $query2=implode("",$request->input('AccCity'));
    
    $token=$request->input('g-recaptcha-response');
    
    
    if(!$query1){
        return redirect()->route('home');
    }
    
    $Employees=Employee::where(DB::raw('EmployeeService'),'LIKE',"%{$query1}%")
                ->where('AccentCity','LIKE',"%{$query2}%")
                ->get();
                

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User • 2 weeks ago

I think the issue is that i only have a a route defined for:

Route::get('/search',[ 'uses'=>'\App\Http\Controllers\[email protected]', 'as'=>'search.results',

]);

How would i then define a route for the second form in :

views/templates/partials/navigation.blade.php

screwtape_mk started a new conversation Search Form Doesnt Work For Authenticated User • 2 weeks ago

I have a form on my home page - it works and returns results; but when i sign-in it doesnt work i.e no results are returned (The form renders fine in both cases just no results).

when signed in the form is in this folder and defined in the navigation bar:

views/templates/partials/navigation.blade.php

When not signed; in the form is in the home page defined by the home view in: views/home.blade.php

The results of the form are in the folder: views/search/results.blade.php

The form when signed in:

                    <a href="{{route('home')}}" class="navbar-brand">
                        <img src="http://spanibox.com/web/images/logo4.png" width="100px;" height="50px;" style="padding-bottom: 15px"title="Spanibox" alt="Spanibox">
                    
                    </a>
            </div>
           
           
           <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
           
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
           </button>
           
            <div class="collapse navbar-collapse navHeaderCollapse">
                    @if (Auth::check())
                    <ul class="nav navbar-nav">
                            <li><a href="#">Timeline</a></li>
                            <li><a href="#">Bookings</a></li>
                    </ul>
                   
                    <form action="{{route('search.results')}}" role="search" class="navbar-form navbar-left">
                            <div class="form-group">
                                <div class="row">
                                
                                    <div class="col-md-6" >
                                        <input type="text" data-type="EmpService" name='EmpService[]' id='EmpService_1' class="form-control autocomplete_txt" autocomplete="off" placeholder="Handiman"/>
                                        
                                    </div>
                                    
                                    
                                    
                                    <div class="col-md-6" >
                                        <input type="text" data-type="AccCity" name="AccCity[]" id="AccCity_1" class="form-control autocomplete_txt1" autocomplete="off" placeholder="Location"/>
                                        
                                    </div>
                                    
                                    
                                    
                                </div>
                                    
                            </div>
                            
                            <button type="submit" class="btn btn-default">Search</button>
                    </form>
                    @endif
                    

The form in home not signed in home page:

        <form action="{{route('search.results')}}" role="search" id="form">
    
            <div class="col-xs-12 col-sm-8 col-md-8 col-sm-offset-2 ">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Find a Handyman near you <small>Independantly rated</small></h3>
                    </div>
                    <div class="panel-body">
                    <form role="form">
                        <div class="row">
                            
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input class="form-control autocomplete_txt" type='text' data-type="EmpService" id='EmpService_1' name='EmpService[]' placeholder="Handiman"/>
                                </div>
                            </div>
                            
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input type="text" data-type="AccCity" name="AccCity[]" id="AccCity_1" class="form-control autocomplete_txt1" autocomplete="off" placeholder="Location"/>
                                </div>
                            </div>
                            
                        
                        
                            <div class="col-xs-6">
                                    <div class="g-recaptcha" data-sitekey="6Lf9mW4UAAAAACtNJIuXY9VlCZ5kg0Ys7Y3ancH_"></div>
                            </div>
                        

                            
                            
                        </div>

                         <button type="submit" class="btn btn-info btn-block">SEARCH</button>
                    
                    </form>
                </div>
            </div>
        </div>
        
        </form>
    </div>
    
    
</div>      

The results page:

@extends('templates.default') @section('content')

@if(!$Employees->count())

No results found

@else

Search Results

                            @foreach($Employees as $Employee)
                                    @include('user/partials/employeeblock')
                            @endforeach


    
                    </div>
                </div>
            </div>
        </div>
@endif @stop

13th September, 2018

screwtape_mk left a reply on Laravel And Webhooks • 1 month ago

i happen to have guzzle installed...any ideas around using that will also do

screwtape_mk left a reply on Laravel And Webhooks • 1 month ago

we assume i have already integrated to it and im only interested in being notified of payments and inserting that payment info into a db

screwtape_mk started a new conversation Laravel And Webhooks • 1 month ago

Hi Guys

So I have to integrate to this payment gateway and store payment data to a db:

http://developer.getsnapscan.com/

According to their api documentation I can use webhooks in which the payment gateway can send payment data to the webhook url and I can send an http request to the webhook url to get payment data that was sent.

I am a newbie to laravel so I am not sure if my idea around this will work.

  1. Create a web hook URL e.g http://mylaravelapp/webhook

  2. Create a controller that will send a GET request to a webhook endpoint(URL)

  3. Create a get route to this controller with the web

     Route::get(‘webhook', '[email protected]’);
    
  1. The data from the Get request can then be inserted into a db

My questions…since the GET request will be defined within the controller…what must be in the web hook? Maybe :

<php

$_POST

?>

4th September, 2018

screwtape_mk started a new conversation Upgrading Laravel 5.0 To 5.6 • 1 month ago

Hi...im currently on laravel 5.0.16 ive been having too many issues and now i want to upgrade to 5.6. Would it be easier to have a fresh installation of 5.6 or there is a way around upgrading to 5.6...i would like to avoid a fresh installation if there is a way

3rd September, 2018

screwtape_mk left a reply on PDOException SQLSTATE[28000] [1045] Access Denied For User • 1 month ago

Hey guys im having a similar problem. Have cleared cache etc but the problem persists. i do understand that the username and password are not being read properly but what changes must be made then

8th August, 2018

screwtape_mk started a new conversation Why Am I Seeing A 404 Page • 2 months ago

7th August, 2018

screwtape_mk left a reply on Parse Error: Laraverl • 2 months ago

how do i remove that

screwtape_mk started a new conversation Parse Error: Laraverl • 2 months ago

I seem to have been hacked...i am not sure...my site worked nicely...but lately its just been having issues.

http://spanibox.com/

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/spanibox/laravel/config/auth.php on line 31

17th May, 2018

screwtape_mk left a reply on Include Custom CSS • 4 months ago

most probably - is it the .htaccess file?

screwtape_mk left a reply on Include Custom CSS • 4 months ago

SOLVED:

So during my laravel set up i had attempted an installation of another script and underwent issues - i now have 2 folders:

public

and

public_html...thats where i must place the custom.css file and not in the first folder...apologies and thanks to all you guys for your prompt responses

screwtape_mk left a reply on Include Custom CSS • 4 months ago

I followed this 2min video when setting up laravel

https://www.youtube.com/watch?v=18YV_1kOJBk&list=PLfdtiltiRHWGGxaR6uFtwZnnbcXqyq8JD&index=4

I hope i didnt break anything

My routes are:

screwtape_mk left a reply on Include Custom CSS • 4 months ago

i really have no idea whats going on- im using laravel version 5.0.16; what i dont get is why is the one file loading while the other doesnt...i imagine no need to create routes since there isn't a route for the working app.css

screwtape_mk left a reply on Include Custom CSS • 4 months ago

i wish i could take a screenshot and show you. thts exactl where the file is public/css/custom.css

16th May, 2018

screwtape_mk left a reply on Include Custom CSS • 4 months ago

Thanks all for your assistance so far

my file custom.css is in public/css right next to app.css. I am loading them both on to a default.blade.php file which is then extended by the home.blade.php which is what you see here : http://spanibox.com/

view page source to see it:

I used this to load them:

I have double checked spellings too many times

screwtape_mk started a new conversation Include Custom CSS • 4 months ago

Hi I dont understand how come link 1 works and link 2 doesnt work. They the same file

link 1:

http://spanibox.com/css/app.css

link 2:

http://spanibox.com/css/custom.css

I used:

Im using laravel 5.0

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.