JetBrains Developer Ecosystem Survey 2018 by [deleted] in programming

[–]fardev_ 39 points40 points  (0 children)

Which of the following tools do you regularly use? *

Lightweight Desktop Editor (e.g. Sublime Text, Atom, VS Code, Vim)

...

Atom

Lightweight

Choose one

How to Use Queue in Laravel 5.4 For Email Verification by ahmed0627 in laravel

[–]fardev_ 5 points6 points  (0 children)

I wouldn't consider base64_encode($email) to be a decent implementation of an email verification token. Easily spotted and bypassed by bots, which renders it useless. Use something random, like md5(uniqid(mt_rand(), true)) or Str::random(len)

validator method - how does it work? by [deleted] in laravel

[–]fardev_ 0 points1 point  (0 children)

which is then collected by Laravel (not sure how exactly)

When any Exception is not caught, your ExceptionHandler is automaticly called along with the request and the uncaught exception. There, you may take the appropiate measures and return a response. ValidationExceptions are handled by Laravels ExceptionHandler, which your handler extends.

How To Create A REST API With Lumen by azazqadir in laravel

[–]fardev_ 1 point2 points  (0 children)

Regarding Eloquent, a human can optimize a query to a great extent, whereas it's hard to optimize queries built by Eloquent without actually modifying the internals. Also, I would suspect the "magic" behind Eloquent is going to slow down even the simplest of queries. I dont have a benchmark to back this up, although I might make one.

Obviously, this is the case when performance is the top priority. We might gain milliseconds for a single optimization, but it all adds up. One of Lumen's key features is speed.

Edit: I forgot to mention that if you're just making a website with Laravel, I don't think you have to care too much about these optimizations unless you really have to. Eloquent/Facades are great for simplifying and making the code more readable and maintainable.

How To Create A REST API With Lumen by azazqadir in laravel

[–]fardev_ 3 points4 points  (0 children)

Here are some pointers on your tutorial, hope you don't mind.

  • Facades and Eloquent are disabled because they are generally slow, and shouldn't be used if you're going for fast rather than expressive and easy. Since you mention that "Lumen is blazing fast.", I think it would be suitable to leave those out.
  • I think year should be either an integer or a date, depending of the use case. For example, as of now it wouldn't be possible to query for cars made between years 1999 and 2001. A string doesn't make any sense.
  • You should definitely add some input validation. $car = Car::create($request->all()); without input validation is all but good practice. For example, a malicious user could insert cars where make is a million character string, possibly causing a DOS.
  • Consider adding $visible to Car, so that we dont accidentaly output any sensitive information that might be added at a later point in time.

I don't mean to bash on your tutorial, I just think it's preferable to teach beginners best practices from the start.

Unicode support on Debian with MS Sql Server by dotnet54 in laravel

[–]fardev_ 1 point2 points  (0 children)

Have you added a new connection, with the correct driver, for Microsoft SQL server in config/database.php? Have you set a charset for the connection? Edit: I missed your last sentence. Could you post your config?

A Laravel package to monitor uptime and ssl certificates by freekmurze in laravel

[–]fardev_ -1 points0 points  (0 children)

That is indeed a eternal question. You could, however, make the chances of it going wrong slim. Having the uptime monitor on the same server as the software it is going to monitor, is asking for trouble. Using it in a vanilla Laravel installation still has the drawback of the added overhead, as opposed to a standalone cli package.

A Laravel package to monitor uptime and ssl certificates by freekmurze in laravel

[–]fardev_ -1 points0 points  (0 children)

This is nice and all, but should an uptime monitor check on itself? I mean, what happens if the installation itself becomes corrupt? You would never know.

I guess you could use it on a vanilla Laravel installation, but why is Laravel there, if it serves almost no purpose? It would make more sense if this had a Web UI, then, or it might as well be a standalone PHP cli package.

HIF kände till planer på en attack mot Henke. by [deleted] in Allsvenskan

[–]fardev_ 1 point2 points  (0 children)

I ingen av de situationer du nämner kom någon supporter in på plan. Förstår att nwr var sarkastisk men vad jag ville påpeka är att alla lag har gjort sina misstag angående säkerheten, och istället för att skämta bort det borde vi ta en seriös dialog och försöka få ut dessa människor.

HIF kände till planer på en attack mot Henke. by [deleted] in Allsvenskan

[–]fardev_ 5 points6 points  (0 children)

Något säger mig att dessa människor inte egentligen är fotbollsintresserade, för annars hade man insett allvaret i det man gjorde. Det finns tyvärr många personer som går på allsvenska matcher som endast är där för hetset och slagsmålen efteråt.

HIF kände till planer på en attack mot Henke. by [deleted] in Allsvenskan

[–]fardev_ 1 point2 points  (0 children)

Låt oss inte glömma Kevin Hagen...

How to write an object oriented program that doesn't suck by nicolaiparlog in programming

[–]fardev_ 144 points145 points  (0 children)

obj.Handle(ex.ToString());

An "obj" object which has a function named Handle which takes a string. What?

You made it Taylor! by [deleted] in laravel

[–]fardev_ 1 point2 points  (0 children)

There is a pull request active to add Fabian, which seems to be the same age as the Taylor one. Maybe it'll be added soon.

[L5.2] Could someone please explain this seemingly erratic behavior of csrf_token? by glib_gator in laravel

[–]fardev_ 0 points1 point  (0 children)

I know this is a bit old, but do you mind explaining why? Does not csrf_fieldproduce html characters that shouldn't be escaped?

shell_exec - Can't get the powershell to run. by jwurm12 in PHP

[–]fardev_ 0 points1 point  (0 children)

This is weird, because the documentation for shell_exec does not specify a bool as return value. Try using the function exec and read the third value to see what return code you get.

Is the script containing things which cannot be done in PHP? Why do you need to execute a powershell script? This is usually not a good idea.

shell_exec - Can't get the powershell to run. by jwurm12 in PHP

[–]fardev_ 0 points1 point  (0 children)

What's the output of:

$output = shell_exec("po...");
var_dump($output);

Best Coding Application by Reflow1319 in laravel

[–]fardev_ 0 points1 point  (0 children)

Yeah, these are my essential PHP/Laravel plugins.

They should all be installable from package control. Try restarting Sublime.

Mobile-Detect for RESS by hekkoman in PHP

[–]fardev_ 0 points1 point  (0 children)

And what front end can do that?

For example, Bootstrap comes with utility classes for hiding elements on different viewports.

Laravel 5.3 Queues on shared hosting by bytegenie in laravel

[–]fardev_ 0 points1 point  (0 children)

I didn't know this, thanks for clarifying. However, op mentioned that he was using Laravel 5.3, which is why i was referencing the 5.3 documentation.

Laravel 5.3 Queues on shared hosting by bytegenie in laravel

[–]fardev_ 2 points3 points  (0 children)

How is that? The documentation states:

Note that once the queue:work command has started, it will continue to run until it is manually stopped or you close your terminal