wick12c

wick12c

Member Since 11 Months Ago

Experience Points 3,090
Experience
Level
Lessons Completed 29
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.

16 May
8 months ago

wick12c left a reply on Vuejs2 @click Not Working In Blade Foreach Loop

Also to note, there are no console errors

wick12c started a new conversation Vuejs2 @click Not Working In Blade Foreach Loop

First time Vue user, moderate in Laravel and good with PHP. A simple blade view containing compact data created by heavy DB queries. Using a foreach loop on the compact data will show one to several results depending on what the user has searched for. The foreach is fine and data is presented in typical blade view fashion. I want to introduce Vue2 and just starting with a simple button creating a @click event (eventually to just show a preloader (no AJAX at this point) to wait for the next page to load.

I am sure there are many ways to do this but this is just a simple understanding of the following:

Button contains:

<button @click="loadPropertyPage('test')">test</button>

Linked to app.js compiled using Laravel-mix:

import Vue from 'vue';


new Vue({

    el: '#root',

    methods: {

        loadPropertyPage(link) {
            alert('test');
        }

    }

})

Works fine.

However, in a blade foreach loop adding the same button does not work:

<table id="bootstrap-table" class="table">
                                <thead>
                                    <tr>
                                        <th data-field="rentalid" class="text-center">Rental ID</th>
                                        <th data-field="brand">Brand</th>
                                        <th data-field="rentalname">Rental Name</th>
                                        <th data-field="accountmanager">SF AM Name</th>
                                        <th data-field="companyname">Company Name</th>
                                        <th></th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>

                                    @foreach($search_data as $results)

                                        <tr>
                                            <td class="text-center"> {{ $results->RentalNumber }} </td>
                                            <td> {{ $results->brandname }} </td>
                                            <td> {{ $results->RentalName }} </td>
                                            <td> {{ $results->AccountManagerName }} </td>
                                            <td> {{ $results->CompanyName }} </td>
                                            <td> <button @click="loadPropertyPage('{{ url('search/property/'.$results->ListingId) }}')" class="btn btn-round btn-info btn-sm">View Property</button> </td>
                                            <td> Another link</td>
                                        </tr>

                                    @endforeach

                                </tbody>
                            </table>

I have replaced the above button with the simple button above and will not work. but if you place the simple button outside of the foreach the button and alert will work.

I am using Laravel 5.6 on Mac OS X.

Just to clarify, not looking for workarounds, just the simple understanding (more education purposes) as to why a vue @click conflicts with a blade foreach loop.

Thank you!

18 Feb
11 months ago

wick12c left a reply on Connect To Company MSSQL Server Using A Domain

This issue has been resolved. The ODBC Driver 13 within the odbc.ini files driver didn't recognise mac's windows credentials. I then installed FreeTDS with unix ODBC which created the necessary library that recognised the credentials which created a successful connection.

For those who are in this scenario, the username should be DOMAINGROUP\username. Use a double backslash so when the connection is made to the server it will tell the server a domain is in use and will remove one backslash. The second backslash is for the server itself which will then separate the two for a domain login. Not sure why but this is the only solution I found that worked.

Hope this helps anyone in need.

08 Feb
11 months ago

wick12c left a reply on Connect To Company MSSQL Server Using A Domain

Further to this, developers in the office are using

$resource = odbc_connect('Driver={ODBC Driver 13 for SQL Server};Server={WORKSERVERNAME}:1433;Trusted_Connection=yes;ApplicationIntent=ReadOnly', null,null);

and now coming up with:

odbc_connect(): SQL error: [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired, SQL state S1T00 in SQLConnect

I have looked into ODBC packages however none seem to have a relationship to Laravel 5.6.

Any help please?

07 Feb
11 months ago

wick12c started a new conversation Connect To Company MSSQL Server Using A Domain

Currently, using native SQL GUIs e.g. RazorSQL I can connect to the company's server for reporting which is setup to use a windows authentication, however, I am wanting to hook up laravel to automate my reporting.

I have tried within the .env _HOST = MYGROUP\hostname and then adding my username and password (used for windows authentication) which produces:

SQLSTATE[HYT00]: [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired

When using _HOST = hostname and my username = MYGROUP\username it produces:

SQLSTATE[28000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 

Database config is using the default setup for sqlsrv:

'sqlsrv' => [
            'driver' => 'sqlsrv',
            'host' => env('HADB_HOST', 'localhost'),
            'port' => env('HADB_PORT', '1433'),
            'database' => env('HADB_DATABASE', 'forge'),
            'username' => env('HADB_USERNAME', 'forge'),
            'password' => env('HADB_PASSWORD', ''),
            'prefix' => '',
        ],

does sqlsrv accept domain as a field? am I using the wrong driver? any help would be much apprieciated.

Oh and the query I am running to test this is:

$haquery = DB::connection('sqlsrv')->table( etc etc

wick12c left a reply on Merge Two Collections Into One With Unique Array

Thank you for your help guys. Yes I managed to put the first query into an array then used array_search to obtain the key to then manually merge the results which did the trick.

03 Feb
11 months ago

wick12c started a new conversation Merge Two Collections Into One With Unique Array

I am new to Laravel and having some difficulty trying to find the answer to my problem. I have one DB query in a collection and another collection from a different DB query (each query is from a separate DB connection).

The example is Collection A has multiple fields with a unique field known as propertyid, Collection B also contains the same propertyid with additional fields and I need to merge them into a single collection and/or array.

When attempting to merge, Collection B is only added to the tail of Collection A. My desired result is to have the one propertyid containing all fields from Collection A and B in the one array. The collection will have a couple of thousand propertyids so instead of looping through each collection and searching for array keys etc I want to see if a simple merge (or similar) can do this.

Thank you so much for any help that would be appreciated.