jimmck

Experience

62,275

52 Best Reply Awards

  • Member Since 4 Years Ago
  • 8 Lessons Completed
  • 1 Favorite

18th August, 2018

jimmck left a reply on Mailable: Non Numeric Value Encountered • 2 months ago

Yeah no need for routes. URL cannot pass class instances! Controllers cannot receive class instances directly from a URL. Use Middleware to inspect a URL from a ROUTE and maybe construct a class instance and PASS it to the controller. Hence the word Middleware. Or if you are more adventurous your code Infer the Class and constructor data in the URL but really why?

Emails have separate URL links than webpages. Different mediums. Emails contains contain more static and/or time dependent data.

17th August, 2018

jimmck left a reply on Mailable: Non Numeric Value Encountered • 2 months ago

@Snapey @vincej Then you could route those URL's to a different class of constructor. You can construct the email to use a whole different set of Controllers than what a normal webpage might call. Share the backend processing once it has been properly routed.

jimmck left a reply on Mailable: Non Numeric Value Encountered • 2 months ago

@vincej Emails have no idea of your servers PHP class structure. What does your URL specifically look like as formatted in the email? Does the URL contain enough unique information to identify the order?

jimmck left a reply on How Can I Listen To The Db In Real Time? • 2 months ago

Database triggers

14th August, 2018

jimmck left a reply on How Can I Convert Many Statement Mysql To Laravel Eloquent? • 2 months ago

You could have done all of this in 1 SQL statement. Are you under the impression that Eloquent will do some magical transformation? It will not. Learn Eloquent and convert it. No one here knows or understands your data or your database structure. What was the purpose of this original SQL? You need to answer to that to convert into Eloquent or any other ORM.

jimmck left a reply on Need Help Understanding Public Functions • 2 months ago

Well your not using $this if the function is part of the controller class. Jeff has great intro videos to basic concepts. Thats what this site EXCELS at.

13th August, 2018

jimmck left a reply on How To Handle Event Listeners In Single Page Application? • 2 months ago

Use Vue. It makes managing events easy.

jimmck left a reply on Problem With Vhosts • 2 months ago

@Viernes Hi Hmm... looked at Acrylic it forwards packets to a proxy server and routes back to local? No we don't what that. I assume you have local hub/router or wifi provider LOCAL to your PC? All of my machines are connected of DHCP LOCALLY and dnsmasq runs locally. I used to do this as you want on a Windows setup. Your running XAmpp which was my original Apache server. So each virtual host needed a hosts entry.

Can you please give me brief overview of your LOCAL Xamp setup: router setup... Or are you stricly one machine localhosting???

Searching for dnsmasq Windows equivalents and so far nothing. Are you running in a VM?

12th August, 2018

jimmck left a reply on Problem With Vhosts • 2 months ago

@Viernes Are you on a Mac? You use dnsmasq and create virtual projects by just adding a vhost entry. Nothing goes in your hosts except the dnsmasq alias you create once. Homebrew has a service for dnsmasq. Works great.

6th August, 2018

jimmck left a reply on Private Method Injection In A Trait • 2 months ago

There is nothing to inject. Traits do not exist on their own. All of the enclosing objects is available to the trait.

jimmck left a reply on Private Method Injection In A Trait • 2 months ago

Traits are shared methods/data added to a class. The class using a Trait still needs to be instantiated.

3rd August, 2018

jimmck left a reply on Laravel - Large Database • 2 months ago

@matteoEB S3 is a service provided for Amazon EC3 cloud infrastructure. The PHP League has a great library for managing the code.

    $s3 = Aws\Laravel\AwsFacade::get('s3');
    $result = $s3->putObject(array ('Bucket' => 'bucket-name', 'Key' => 'xxxxxx', 'Body' => 'Hi!!!!!',));
    print  $result['Expiration'] . "\n";
    print  $result['ServerSideEncryption'] . "\n";
    print  $result['ETag'] . "\n";
    print  $result['VersionId'] . "\n";
    print  $result['RequestId'] . "\n";
    // Get the URL the object can be downloaded from
    print  $result['ObjectURL'] . "\n";

http://flysystem.thephpleague.com/docs/adapter/aws-s3/

1st August, 2018

jimmck left a reply on Getting Data Into Vue Component • 2 months ago

You need to show your Blade file.

25th July, 2018

jimmck left a reply on VUE Js Sending Data As A Props • 2 months ago

@amjadkhan896 HiWhen you mean hide? Do you mean the JavaScript source? In that case on non secure sites no. The browser view source shows all the code delivered to the browser. That kind of data has to come from the server over HTTP. And then if you don't have anything monitoring HTPP traffic only the browser app knows. https connections are much more secure you can't see a lot of stuff in the browser anymore. There are plenty of examples of locking down apps. You need to be more specific in what your design is.

jimmck left a reply on VUE Js Sending Data As A Props • 2 months ago

In older versions of Vue props were 2 way. So you send/get data with components. Since then props are strictly one (read only). I have always treated props as custom HTML attributes used to configure the Vue component. I use component methods to get/set data with a component. Of course you have to give unique Id to each component instance so can message it.

22nd July, 2018

jimmck left a reply on Any “famous” Sites Built With Laravel? • 2 months ago

Fully stocked with popcorn!

20th July, 2018

jimmck left a reply on Mixing Vue SPA With Laravel Routes • 2 months ago

Yes. I only write SPA Vue apps. Post messages to specific Laravel routes. I use JSON for the message protocol.

19th July, 2018

jimmck left a reply on LARAVEL OR PHP VERSION ISSUE !! • 2 months ago

MySQL is not installed for one.

14th July, 2018

jimmck left a reply on Union/Join/Merge Table To Get The Result • 3 months ago

@ravipw1801 Hi again. Do you know how to join tables in a database? There is no magic Eloquent solution. If you don't understand SQL you will not be able to solve the problem. You have listed your Table schema's. There is no way to answer your question, only you understand the actual structure of the data.

13th July, 2018

jimmck left a reply on Union/Join/Merge Table To Get The Result • 3 months ago

If a user_id can post either a business or social type you can join on that. You may need a mapping table to help match different business/social relationships (Metadata).

21st June, 2018

jimmck left a reply on Can't Connect To Mysql • 3 months ago

Make sure access to MySQL is allowed for localhost.

https://dev.mysql.com/doc/refman/8.0/en/problems-connecting.html

Latest MongoDB releases as well.

7th May, 2018

jimmck left a reply on Putting Model Data Into More Than One Tables • 5 months ago

@saadaan The proper way to describe that matrix is 8x250. Its important to use proper terms. No real reason why this would be in a database. If its a fixed dimension randomly accessed file should suffice. Floating point numbers don't index or search in a database.

6th May, 2018

jimmck left a reply on Putting Model Data Into More Than One Tables • 5 months ago

@saadaan Describe the data arrangement of the matrix. Its 250 columns by 8 rows? What do the 8 rows represent? And columns? Are the 8 rows distinct? There are many ways to represent a matrix in a database schema.

25th April, 2018

jimmck left a reply on Can't Turn An Object Into An Array. • 5 months ago

This object has private, protected or public data members only a constructor which takes an array and a method to iterate the array.

19th April, 2018

jimmck left a reply on Slow MySQL Query With Laravel Eloquent • 5 months ago

@rafito Your query is doing a count and checking if 2 other selects have any rows? Since I don't know your data sets why are you doing the exists at all? Either the count result will be zero or > 0. The 2 exist selects seem to filter a result set? What is the main driving table in relation to these 2 exist sub-queries? Just creating indexes to speed up a query can hurt the overall performance of your database. Proper indexes will help the optimizer limit the table scan, too many indexes can force a full table scan. Do SQL Explain plan on this query to see what the optimizer will do.

17th April, 2018

jimmck left a reply on PHP Fatal Error Says Exception\Handler Does Not Exist In An Essentially New Laravel Build • 6 months ago

What is the name of the class in $concrete? composer.json file is not shown. No stack trace? As already stated debugger or put a dd in Container.php ( you can clean it later).

16th April, 2018

jimmck left a reply on Laravel 5.2 -> Laravel 5.6 Framework Upgrade • 6 months ago

@joshuabedford I use many libraries from the collective and they run fine in 7.1. Main issues I have is PHP code written for 4.x or early 5. Code written in a less (OOP) style in older PHP naming conventions will generate many warnings and will fail silently in certain situations (like pass by ref vs. pass by value) and packages not using Use causing namespace collisions.

jimmck left a reply on MCrypt Deprecation Warning Breaks File Upload - PHP7.1 MCrypt Laravel 5.2 • 6 months ago

@joshuabedford Glad you got it going. The "Composer Fire Dance" is very important to understand. When I first started using this it was frustrating and seemed stupid. Learning the tool saved time, help find problems and fix them. You should do the upgrade to 5.6 yourself to learn the Laravel environment. What are your deprecated features you depend on (Laravel deprecated they die hard and FAST)? If you are using 7.13 already good. Otherwise you have PHP remediation to do in order to move PHP 7.13.

5th April, 2018

jimmck left a reply on MCrypt Deprecation Warning Breaks File Upload - PHP7.1 MCrypt Laravel 5.2 • 6 months ago

@joshuabedford You cannot use mcrypt. A link in the article I posted when to another report. Did you read that? What is the OpenSSL version in your installation. I had many such incidents when moving to 7.x You have look at the code and the 7.x release notes and mitigate it.

https://github.com/phpseclib/phpseclib/issues/1134

There are no magic solutions.

Dont publish the whole stack trace, the first 25 lines will work. What versioin of phpspec are you using same with OpenSSL.

27th December, 2017

jimmck left a reply on Extending A Vendor Package • 9 months ago

Well you can fork it. Put it into your own repository and reference that instance in your. Remove the original package.

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyUtils"
        }

14th December, 2017

jimmck left a reply on Setting Up The Command Line In PHPStorm / Windows / Homestead • 10 months ago

https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

If things don't seem synced, remember to 'Synchronize your project after updates.

Right click on the top of the project tree in the project pane on the left side to get menu and select Synchronize name.

jimmck left a reply on Phpstorm Command Line Tools And Vagrant / Homestead(SSH) • 10 months ago

https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

If things don't seem synced, remember to 'Synchronize your project after updates.

Right click on the top of the project tree in the project pane on the left side to get menu and select Synchronize name.

12th December, 2017

jimmck left a reply on Adding 0.000005 To 0.000005? • 10 months ago

@13en Are you trying to update all of the rows in your DB where the cost is > .0000005 + .000005 ? Using a formula as a part of a where clause? My initial thought was/is can't work. But apparently in MySQL there is way. Which looking at the solution with an alias and HAVING seems interesting. Note I have not tried this yet, going to to so as its interesting. Remember Eloquent is an ORM not an extension to SQL. All Eloquent code turns into SQL and may further process the returned result sets. Of course any searches apply to result sets. But interesting question! I will be check this further. Good Luck.

https://stackoverflow.com/questions/21353959/sql-query-by-adding-two-columns-in-where-clause

Here is search URL

https://www.google.com/search?q=mysql+where+clause+with+formula&oq=mysql+where+clause+with+formula&aqs=chrome..69i57.20663j0j7&sourceid=chrome&ie=UTF-8

10th December, 2017

jimmck left a reply on Will Laravel Have A Official Implementation Of Websockets (real-time)? • 10 months ago

Check out ZMQ works great with Rachet/PHP/Java/JS.

Not sure what you mean by official Laravel. You can many things.

http://zeromq.org/

6th December, 2017

jimmck left a reply on How To Render A Component When You Ajax The Html? • 10 months ago

@check202 Also check out Sue Drasner's excellent series on Vue.

https://css-tricks.com/intro-to-vue-1-rendering-directives-events

jimmck left a reply on How To Render A Component When You Ajax The Html? • 10 months ago

@check202 Hi. You don't really seem to understand Vue. Dynamic rendering is what it does. Jeff has a free and excellent video series on Vue. I suggest you start there. nextTick events by the way are part of the regular update cycle in Vue when it renders parts of the DOM which have changed.

28th November, 2017

jimmck left a reply on How To Mix Multiple Js In One? • 10 months ago

Jeff has a great Free video series on Webpack and laravel mix.

6th November, 2017

jimmck left a reply on Composer Help • 11 months ago

Now that we understand the problem. Here is how I pull my GIT packages. The projects composer.json

   },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyUtils"
        },
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyMongoDB"
        }
    ]
}

@Cronix !!!

jimmck left a reply on Composer Help • 11 months ago

Lookup the package on packagist.org and follow the install instructions. If there is no install for it don't put in the vendor directory.

5th November, 2017

jimmck left a reply on Adding A Space.... • 11 months ago

In sql

select first_name || ' ' || last_name as name ...

Double Pipe

||

Is the ANSI standard for concatenation in SQL.

1st November, 2017

jimmck left a reply on Laravel Frequently Showing 'Undefined Variable: _SERVER' • 11 months ago

Are you all working in the same shared laravel directory? I assume you are running one actual server instance not 4 off the shared directory?

30th October, 2017

jimmck left a reply on How Can I CONCATENATE. • 11 months ago

In SQL || "Pipe Pipe" concats separate DB columns.

select first_name || last_name as Name, age, city ...

27th October, 2017

jimmck left a reply on Pi (π) Button • 11 months ago

Prime number sieve function?

jimmck left a reply on Check For Duplicate Entry And Skip During Import? • 11 months ago

As @Snapey is asking, How many records to import? The database will be do this check for you with the constraint violation on import as shown (When fail next record from input is read). But as the master table table grows the time to insert will increase as each insert will take time to scan THE constraints. You can of course maintain an array of inserted records from the source and have the loader check this array before insert. Shorter list to check and in memory.

13th October, 2017

jimmck left a reply on Change Imported File Encoding In Laravel • 1 year ago

You cannot just change the encoding of a whole file. You have to parse the content. And Excel files are a Binary format you cannot try to convert a binary file like this. There is no "magic" way to do this.

12th October, 2017

jimmck left a reply on Combine Two Tables Into One Result Set. Merge/append/join • 1 year ago

@patrykszady Can you list the 2 table columns? If you want one result set you will need to join the 2 tables. Eloquent ORM will not solve this problem efficiently you will end up passing in a raw query. A SQL query will do the merge/append/join that you require that is what SQL is for. Are you using MySQL? This is probably a great use off a Group By with Rollup. You will get a result set with expected results. The ORM will be break this up into many queries and then attempt to merge data or worse leave you with a bunch on collections to manually combine. I know of only one reader of this forum who may be able to show an Eloquent way, but I have not seen him in a long time.

jimmck left a reply on Combine Two Tables Into One Result Set. Merge/append/join • 1 year ago

Hi, What are the columns for each table ? Is expense_splits.expense_id related to expenses.id meaning the splits table has many instances? What is the purpose for each table?

6th October, 2017

jimmck started a new conversation Fractional Units CSS GRIDS Video Is Not Free? • 1 year ago

In the CSS Grids series Fractional Units is not free? The others can be viewed?

30th September, 2017

jimmck left a reply on Vue Refs • 1 year ago

$refs point to Vue components. clockpicker is dependent on JQuery. If you want to port it you have to make it an actual Vue component. Or just use JQuery in your Vue app, its easily done. But JQuery components will not show up in your $refs array unless it is wrapped into Vue component.

Edit Your Profile
Update

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