matalina

Web Developer at Baber's Inc

Experience

6,035

0 Best Reply Awards

  • Member Since 4 Years Ago
  • 131 Lessons Completed
  • 6 Favorites

19th September, 2018

matalina left a reply on SQL SRV Not Escaping Correctly • 3 weeks ago

simple as it can be will cause the error.

Model::where('FirstName','LIKE',$first_name.'%')->first();

That's simplified of course.

And I realized I can do this on a one by one basis, but this can potentially hit every single string query that I've ever written....that touches the MSSQL.

Extending part of the Model, or writing a different eloquent model to correct this parsing issue is the simplest and easiest way to catch all the potential problems.

But the simplist solution at present is to not use MSSQL to check customer accounts against. It's a slightly delayed process to create account stubs in mysql where I can escape properly without rewriting the code.

It doesn't prevent any potential breaking down the line for future MSSQL queries, but it at least solves the issue here and a few other operational issues on the business side.

matalina left a reply on SQL SRV Not Escaping Correctly • 3 weeks ago

Yes I'm aware that the issue is not with Laravel. I'm looking for a Laravel way to fix the problem since it's PDO and MSSQL thing and I don't want to dig too much deeper. I'll do a work around.

Writing raw queries in place of EVERY single WHERE statement that uses a string as it's value is not a feasible solution.

I assumed for as many years as I've been using Laravel that Eloquent was escaping those characters correctly. I've never had any problems with any of the drivers until now (and if I did I never had any issues reported :( )

I believe this is the first PDO/Eloquent string I have searched, usually I'm only pulling numbers from that database but I don't know if it is broken anywhere else so I wanted a global fix in Laravel to mitigate the problem so I don't get errors like this.

18th September, 2018

matalina started a new conversation SQL SRV Not Escaping Correctly • 3 weeks ago

I've already googled: This issue came up - https://github.com/laravel/framework/issues/24123

Basically whenever I have a single quote in a query for the MSSQL server I get the following error:

SQLSTATE[HY000]: General error: 105 Unclosed quotation mark after the character string ''. [105] (severity 15)

Can I extend the eloquent drive to automatically apply the '' to my query. Or some other means of doing this 100% across the board for ONLY MSSQL (I use mysql as well - not my choice to use MSSQL - only reading from MSSQL)

21st May, 2018

matalina left a reply on Eloquent Don't Return A GUID From SQL Server • 4 months ago

Hate to bump an old thread, but do you happen to know if this will work with a relationship.

I do though I will need to add this to some of my models I currently have many guids I need to convert and do it through getAttribute functions.

6th June, 2016

matalina left a reply on Designate Connection For Password_resets Table Other Than Default? • 2 years ago

Not really. I made my default database the one that had the password and users in it. It fixed it, but I didn't figure out a way to use another database as my user database.

29th February, 2016

matalina left a reply on Designate Connection For Password_resets Table Other Than Default? • 2 years ago

I managed to see that you CAN set a connection deep down inside of the Password Resets but I didn't find a way to set that specific connection before that level. I got lost in the hierarchy before I just made my default connection the one with the users and passwords on it since in ALL my Eloquent models I explicitly assign a connection (mostly so I don't forget which model goes to which database since several model files have the same name).

24th February, 2016

matalina left a reply on Designate Connection For Password_resets Table Other Than Default? • 2 years ago

The method provided should only work if the only difference is the connection is the Databases. ie: mysql Database 1 = main database 2 = new_db

I need to change connection completely. Meaning I have my main database tables on one server and a second database on another server. Authentication works great with Model files because of the connection, but I can't figure out how to set a database config to be used with password resets.

Note: I already tried the above method and it does not work in this situation.

13th October, 2015

matalina left a reply on After Update Default Logout Not Working • 3 years ago

I don't know what the problem was but renaming my logout method fixed the problem. If I use getLogout it causes issues. I'm assuming something is messing with inheritance and I just didn't bother with finding the root cause since I could just rename the function and be golden. getLogout does nothing with my routes now so I shouldn't see that error again.

Thanks for your help.

16th September, 2015

matalina left a reply on After Update Default Logout Not Working • 3 years ago

That's what I thought as well.

Laravel is reading the route correctly: route:list shows correctly:

|        | GET|HEAD                       | logout                                | logout                          | App\Http\Controllers\Auth\AuthController@getLogout                         | auth       |

matalina started a new conversation After Update Default Logout Not Working • 3 years ago

I just updated to the latest composer package and now my logout function isn't working.

FatalErrorException in VerifyCsrfToken.php line 101:
Call to undefined method Symfony\Component\HttpFoundation\HeaderBag::setCookie()

This method does not exist, did Symphony have a change?

Using a route binder:

$router->group(['middleware' => ['auth']], function () use ($router)
        {
            $router->get('logout', [
                'as' => 'logout',
                'uses' => 'App\Http\Controllers\Auth\AuthController@getLogout'
            ]);
        });

26th August, 2015

matalina started a new conversation Best Video/Series For TDD Of A Full App • 3 years ago

I very much need to start this for my work. I'm rewriting our intranet from CI to Laravel 5.1. The biggest problem before was I make a small change here, and I break something someplace else.

I would like to find a tutorial or even just a web cast of an application in Laravel being built in a TDD way.

I get the theory behind it. A lot of what my job entails is taking a set of data and manipulating it to get more data to put in reports. I don't know what this data looks like until I get it, so writing a Test first is always going to be difficult. I didn't write the underlying schema, I have NO control over it, I can only access it to read it and then spit it out in a format my boss wants it in. But if I can get my repositories tested so that when I inevitably make a change for my boss that I won't break something else.

So what would you recommend I watch here at Laracasts to get a good handle on TDD in Laravel on an actual app. I THINK I've already watched a few here but I'd like to here your thoughts.

18th August, 2015

matalina left a reply on [L5] Where To Add Custom Validation Function? • 3 years ago

I know this is an old topic but I wanted to add. For overriding implicit extensions (which is what I was searching for specifically) in 5.1 there is the addImplicitExtensions method in the Validator class. There is no need to override the array itself:

$this->addImplicitExtensions([
            'require_at_least_one' => 'App\Validators\CustomValidator@validateRequireAtLeastOne']
        );
Edit Your Profile
Update

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