screwtape_mk

screwtape_mk

Member Since 8 Months Ago

Experience Points 690
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
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
1 month ago

screwtape_mk left a reply on FATAL ERROR In ../storage/framework/views/4adc42dcb226305d1eac13e0ba17bb7c

Solved! I didnt have to clear cache but there was a line of code in the main view in which i hoped was commented out:

Apparently that was read by the compiler and through an exception

screwtape_mk left a reply on FATAL ERROR In ../storage/framework/views/4adc42dcb226305d1eac13e0ba17bb7c

The full error says:

FatalErrorException in 4adc42dcb226305d1eac13e0ba17bb7c line 17: syntax error, unexpected ','

Not sure why that must happen lets hope clearing cache fixes it

screwtape_mk started a new conversation FATAL ERROR In ../storage/framework/views/4adc42dcb226305d1eac13e0ba17bb7c

Hey Guys...whats the purpose of the files in that directory...i get a "Fatal Error, unexpected ','" Hope thats enough info.

I didnt write the codes in those files but they appear to resemble parts of my code in the normal

/laravel/resources/views directory.

16 Oct
3 months ago

screwtape_mk left a reply on Pass Multiple Array Variables To The Same View In A Controller

I have actually built a whole application based on CodeCourse videos going live at the end of the month. Thanks for the reccommendation

screwtape_mk started a new conversation Pass Multiple Array Variables To The Same View In A Controller

Hi

I have 2 Variable Arrays I wish to pass to a view; $Employees and $Payments.

My controller :

return view('search2.results2')->with('Employees',$Employees);

I also wish to pass:

return view('search2.results2')->with('Payments',$Payments);

Each of these arrays are very complex SQL views defined in my Model folder which i dont intend to make any more complex by making them ONE SQL View

08 Oct
3 months ago

screwtape_mk left a reply on Object Of Class StdClass Could Not Be Converted To String

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

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

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

03 Oct
3 months ago

screwtape_mk left a reply on Cannot Use Object Of Type StdClass As Array

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

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

25 Sep
3 months ago

screwtape_mk left a reply on Search Form Doesnt Work For Authenticated User

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

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

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

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

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

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
13 Sep
4 months ago

screwtape_mk left a reply on Laravel And Webhooks

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

screwtape_mk left a reply on Laravel And Webhooks

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

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

?>

04 Sep
4 months ago

screwtape_mk started a new conversation Upgrading Laravel 5.0 To 5.6

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

03 Sep
4 months ago

screwtape_mk left a reply on PDOException SQLSTATE[28000] [1045] Access Denied For User

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

08 Aug
5 months ago
07 Aug
5 months ago

screwtape_mk left a reply on Parse Error: Laraverl

how do i remove that

screwtape_mk started a new conversation Parse Error: Laraverl

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

17 May
8 months ago

screwtape_mk left a reply on Include Custom CSS

most probably - is it the .htaccess file?

screwtape_mk left a reply on Include Custom CSS

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

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

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

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

16 May
8 months ago

screwtape_mk left a reply on Include Custom CSS

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

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