Buy your loved one the ultimate gift. Lifetime gift certificates are $100 off.




9 Best Reply Awards

  • Member Since 8 Months Ago
  • 203 Lessons Completed
  • 0 Favorites

14th December, 2017

Thyrosis left a reply on Can't Click On 'mentions' Menu Using Current Firefox • 3 days ago


I've got the same issue with Firefox on Windows 10.

8th December, 2017

Thyrosis left a reply on PHPStorm • 1 week ago

I've been using Sublime for about six years, haven't missed PHPStorm at all.

Since Jeffrey made the VScode course available I've switched to that, as it's a really nice IDE too.

To be fair, if you're here asking questions about why it's paid software and having to watch tutorials to see if it's worth it: it's probably not. Stick with Sublime, switch to Code. They're both free to use and will probably offer enough for you to work with.

3rd December, 2017

Thyrosis left a reply on Relationship Laravel • 1 week ago

In similar situations, most systems I've seen don't even allow the deletion of non-empty categories. They'll ask the user which action to take to allow the deletion, so offer the choice between also deleting the linked models (wether it be posts in a specific forum-channel, products in a category or characters in a rpg membergroup) or moving them to another 'parent'.

So in your case it depends on what you need. Are you programming it for your own usage? The program it the way you want it. Are other people going to be using your application? I'd suggest giving them a choice.

Thyrosis left a reply on Relationship Laravel • 2 weeks ago

It depends on the project you're working on.

One option would be to delete the products when a category is deleted, either using the foreign key cascade Aardalich mentioned us just going the 'Laravel' way:

foreach ($category->products as $product) {


Another option could be to move to products to a different category (maybe even an archive category). In case of things like a webshop, you should always keep the product available somewhere to check back on orders.

foreach ($category->products as $product) {
    $product->category = Category::getArchive();

Or lastly, if you don't have a problem with orphaned products, you can just set the category to 0 and be done with it. You can then get all products which are not related to a category and maybe mass update them.

2nd December, 2017

Thyrosis left a reply on How To Change From SSL Url To Non SSL Url • 2 weeks ago

Maybe there's a redirect to https:// in the .htaccess-file (in public folder)?

Thyrosis left a reply on Why Is Laravel Not Running In Wamp? • 2 weeks ago

Do you have the same symlink setup as in the live server?

I know in my own project I've got that issue. It's running live on Linux and I've set the symlink from public to storage, but on my Windows dev environment it doesn't have a symlink thus all images are unavailable.

Thyrosis left a reply on Why Form Is Not Submitting Input Fields To Server ? • 2 weeks ago

I think that might be due to the way your browser parses the form and sends it upon submission.

Have a look what happens if you remove the divs and have the input fields straight inside the elelement. You should be able to see the fields then.

Maybe this will help?

Thyrosis left a reply on How To Change From SSL Url To Non SSL Url • 2 weeks ago

The URL should be set in the env-file under APP_URL or in config/app.php under 'url'.

Thyrosis left a reply on Whats The Logic To Make EXP Point Like Laracast? • 2 weeks ago

Well, that shouldn't be too hard?

Instead of incrementing the experience in the [email protected], increment it in the function which sets the status of the post to published.

In that case, you'll use $thread->owner instead of auth()->user(), because obviously the authenticated user is the admin itself.

Thyrosis left a reply on Whats The Logic To Make EXP Point Like Laracast? • 2 weeks ago

I've actually just implemented this in my own forum, because it sounded cool to have.





return [

    'experience' => [
        'new_reply' => 5,
        'best_reply' => 25,
        'favourite_reply' => 1,
        'new_thread' => 10,
        'new_threadsubscription' => 5,
        'archive_thread' => 50,
        'new_character' => 10,

[email protected]

auth()->user()->increment('experience', config('custom.experience.new_thread'));

[email protected]

$thread->owner->decrement('experience', config('custom.experience.new_thread'));


<div class="panel-heading">{{ $profile->name }} <div class="pull-right">{{ $profile->experience }} exp</div></div>

And then just call the increment function on whichever action you want and have defined an experience score for.

1st December, 2017

Thyrosis left a reply on Whats The Logic To Make EXP Point Like Laracast? • 2 weeks ago

Add a column 'exp' to the users table.

Then for each reply, add x amount of points to that users exp. Same for best reply marked or any other action that you reward points for.

When a reply is deleted or any other action is reversed, remove the same amount of points you rewarded.

This way you always have a real time representation of the amount of exp used and you don't have to calculate it on the fly.

Thyrosis left a reply on CURL Requests Not Working When Pushed To Live Server • 2 weeks ago

Two things come to mind: There could be a restriction on their API based on an IP address, so that when you access the API from a different server it won't let you connect. Your Ravelry dashboard or admin page could help you out on that one.

The second thing is to dump result without json_decode wrapped around the curl_exec. Because now your dumping the result of the json decoded result which, if the result isn't json, won't give you much to go on.

30th November, 2017

Thyrosis left a reply on Accessing Authenticated User In ServiceProvider • 2 weeks ago

I got it!

Well, no, I didn't. But hey, at least I got it to work :)

Instead of going with a ServiceProvider, I'm now using Middleware. It's simple really if you think about it...

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\View;

class CheckTheme
     * Handle an incoming request.
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
    public function handle($request, Closure $next)
        $views = resource_path("views/themes/default");

        if (auth()->check()) {
            $views = resource_path("views/themes/{auth()->user()->theme}");

        View::addNamespace('theme', $views);
        return $next($request);

I've added it to the app/Http/Kernel.php file in the web MiddlewareGroup after the session middleware has been run, so the session (and thus getting an authenticated user with auth() ) is available in the CheckTheme middleware.

So there you have it. No ServiceProvider, but a solution nonetheless. If anyone has the answer to the original question, I'll still have it though - I just figured ServiceProviders aren't supposed to be used for these kind of situations.

28th November, 2017

Thyrosis left a reply on How To Use Laravel Scout Free • 2 weeks ago

Algolia does offer a free plan with up to 30 queries per second, 10K Records and 100K Operations. That seems okay for any free plan and also seems enough for most run-of-the-mill sites.

Personally I'm a big advocate for investing in your infrastructure and using and paying for what you need to successfully run your site. Now I have to say, to upgrade from a free plan to $35 is a pretty steep jump. Then again, if your website runs out of the available options on the free plan, you should be able to generate enough revenue to cover your costs.

ElasticSearch starts at $45 for the hosted solution so is even more expensive than Algolia. If you want to run it yourself, you'll need to install it on a server running Java, so like Martin already mentioned, you'll be spending some time in setting it up and incur some running costs.

You could also try, they offer a free plan (2 indices, whatever that means). Or Amazon Cloudsearch (, there you only pay for what you use. Same for Azure Search (

So yeah, apparently searching services are rather expensive. If they're too expensive and your project allows it, maybe your better off implementing your own search functionality.

Thyrosis left a reply on Laravel Tinker • 2 weeks ago

What kind of command do you want to run?

If you're looking for Artisan commands, you can just trigger them from a controller or even your routes file. Have a look here:

Thyrosis started a new conversation Accessing Authenticated User In ServiceProvider • 2 weeks ago

Question: How do I make an authenticated user available in a custom ServiceProvider's boot method?

Explanation: I'm working alongside the forum-course here at Laracasts, but am implementing my own features as we go along. In this case, I'm working on the possibility to use different themes which a user could set in user-settings.

Now, to use this, I'm using vendor namespaces as described by Sebastian De Deyne here:

It works like a charm. My view folder now looks like this:

-- themes
--- default
---- all the view folders and blade views
--- otherTheme
---- all the view folders and blade views

Now, in my ThemeServiceProvider I declare the folder the theme should be loaded from:

public function boot(Request $request)
        $views = resource_path("views/themes/default");
        if (auth()->check()) {
            $views = resource_path("views/themes/otherTheme");

        $this->loadViewsFrom($views, 'theme');        

This works fine for loading the default theme. When I manually change the 'default' to 'otherTheme', the other theme gets loaded. Awesome!

The problem resides in the auth()->check(), because at the moment the boot method is fired, there has been no session and thus, no authenticated user is found. In other words: the default theme will always be returned.

Sebastian comments on this by saying:

We're assuming the current "client" object gets resolved from the IoC container.

Well, that's all fine and dandy, but now I'm trying to figure out how to do just that. This means that I need to access the authenticated user or the session in the boot method of my custom ThemeServiceProvider, but I can't.

So hence my question: How do I make an authenticated user available in custom ServiceProvider's boot method?

I've been googling for hours now and all the results I can find are talking about view composers. But in this case, I can't use view composers, seeing as I need the user to decide which view to compose. For instance, to inject a few global variables, I do this:

view()->composer('', function ($view) {

Here, theme:: is loaded with the correct resource path for the currently selected theme.

I know it must be possible, but I just don't know which direction to search in.

24th November, 2017

Thyrosis left a reply on How Do You Work With Different Computer? • 3 weeks ago

@CJJ Ah maybe I was misunderstood. I do of course use a .gitignore file for all those things you mentioned, except for number 4. For my composer updates I do a separate commit.

But apart from that, I'm still ignoring .env for environment-based settings, logs, storage and the like.

21st November, 2017

Thyrosis left a reply on How Do You Work With Different Computer? • 3 weeks ago

I'm developing on two Windows 10 machines, one with Wamp, the other with Xampp. In the office, there are two guys running Linux. Both our staging as our live server are Linux. Honestly, if yo configure things right, it doesn't matter what OS you are using.

Regarding GIT: Personally, I'm cheating. I haven't ignored my vendor folders. They're included in my repository. Yes, it makes for a bigger repo, but yes, it also means I only need to run composer update once. Just make the commits and push them as you are used to, the pull (or fetch+local merge if you are using GITGUI) before you continue on your home environment.

16th November, 2017

Thyrosis left a reply on Make My Website As An Application • 1 month ago

There's no point. Search engines index URIs, not content. And it doesn't do too well with JavaScript either I don't think, but that's besides the point.

If a crawler hits your page and sees content X, follows a link and sees content Y but with the same URI, it will not index content Y because that URI is already used for X. Or maybe Y will replace X. Either way, just the one content will be indexed, not both.

So for SEO purposes, what you are trying to achieve isn't your best option. But I imagine it to look very spiffy :)

Thyrosis left a reply on Get Client IP Address • 1 month ago

It will get the client public IP. Run it on a live server and see the results. You'll see your own public IP pop up.

11th November, 2017

Thyrosis left a reply on How To Pass Multiple Variables In To A View Using Controller • 1 month ago

You're not using compact correctly I think.

Instead of passing an array, you should just used a comma separated list. So not this:

compact(['categories', 'products'])

But this

compact('categories', 'products')

8th November, 2017

Thyrosis left a reply on Error When Hosting A Laravel Site • 1 month ago

Not to be rude, but the first step to become a web developer should be to make sure you have the correct tools to work with and, if you don't have them, either get them or get someone to get them for you. All of us are developers here, but only some of us know a few bits and pieces on server management. Everybody else uses things like Homestead, Valet or Forge.

What you need is a working server. If your VPS was provided to you by your college or lecturer, go back to them and tell them your servet isn't set up properly. If your lecturer is 'too busy' to answer your question: Im sorry but what on earth are you doing there then? He gets paid to teach you. Answering questions is what he does, or at least should do.

So there you have it. The problems you run in to are none to be solved by us, they need to be resolved by the person who manages your server. And unless that person should be you as part of your tuition, you should direct your questions at them.

6th November, 2017

Thyrosis left a reply on Why There Is No Shortcut Command For Seeder? • 1 month ago

Ah right, I get it. Got confused with the factory and seeder, I just call the factory n number of times in the databaseseeder file.

But seeing as there is a make:seeder call and a seeder is (I suppose) directly related to a model, you could say that a -s option to the make:model would be helpful. Maybe open an issue on Github, although I don't know whether feature requests would be considered an issue...

4th November, 2017

Thyrosis left a reply on Why There Is No Shortcut Command For Seeder? • 1 month ago

Doesn't -a take care of that since Laravel 5.5?

26th October, 2017

Thyrosis left a reply on Laravel Gate Error, No Such Table: Permissions (SQL: Select * From “permissions”) • 1 month ago

It seems like you're missing the migration file for you permissions table. Did you create the table manually or us a migration?

In case of the latter, check the spelling. Maybe you changed its name after you ran the migration? And are you including the migrateDatabase trait in your test file?

Also, does it work in 'the real world', so when you browse to your app? In that case, the table does exist, but doesn't get created by phpunit (hence the migration question).

21st October, 2017

Thyrosis left a reply on Email Not Sended With Namecheap • 1 month ago

If you're on a shared host, contact their support team to check the servers mail logs. Provide them with a test script they can access so they can check whether the mails are actually offered to the mailserver to be sent.

Usually they get stuck in outgoing or incoming filter due to some missing formatting or incorrect headers.

19th October, 2017

Thyrosis left a reply on Should I Stick With Resource Controller? • 1 month ago

@topvillas, don't you get an abundance in controllers then?

For instance, I have a moderation controller. My threads can be pinned, locked and archived and the opposites, which account for six different routes in the ModerationController.

Sure, I could make a PinThread-, ArchiveThread and LockThreadController, but then I have three separate controllers.

Which has the preference, according to common standards or practices?

Thyrosis left a reply on Emailing In Bulk • 1 month ago

It depends on how you host your application.

If its on a shared host, they usually have limits as to how many emails are allowed to be sent out every day. So that won't work.

When you host your own server, there is usually no limitations. But, if you don't set up your email properly, you'll end up in spamfolders and be blacklisted before you know it.

Avoiding this takes work and knowledge of emails, spamfilters and DNS. For instance, you'll need to set up your SPF records and use DKIM and your emails need to comply with certain rules.

Using mailchimp takes away all these worries. They make sure their mailservers are set up properly and that no foul mails are being sent from their servers. You just have to provide them with the email addresses and the content, they do the rest.

18th October, 2017

Thyrosis left a reply on Route Resource/CRUD Problem With Slug And Id • 1 month ago

Maybe you can play around with the order of the lines in your routes file. Sometimes an uri matches a route too soon in the file and the route you want it to take gets ignored.

What you could also do is make sure your slug is unique and then forgo the id completely. You can use the getRouteKeyName method to override the way Laravel expects the unique identifier to show up in the uri. Append a counter to the slug to avoid duplicates.

7th October, 2017

Thyrosis left a reply on How To Confirmation Before Delete Record From Database? • 2 months ago

Easiest way is probably to have some javascript catch the submit buttons click and pop up an alert to ask for confirmation. On yes, have the form submitted to the delete-route. On no, do nothing.

An other way is to create an 'in between' route which is handled by the controller and shows a different view and you put you call to the delete route in that one.

Personally I'd go with the javascript, to keep the routing as basic and restful as possible.

2nd October, 2017

Thyrosis left a reply on DNS Issues With Nginx And .money TLD • 2 months ago

I'm not sure whether you changed anything already, but I can reach No problem in either Edge, Chrome or Firefox. I'm being served from

Maybe 'plenty of time' wasn't plenty enough after all :)

30th September, 2017

Thyrosis left a reply on Rewrite Url Problem • 2 months ago

A 404 means that you do get to your server, but the file is not found.

What do you get when you visit ?

14th September, 2017

Thyrosis left a reply on Eagerloading Relationship, Maybe Polymorphic? • 3 months ago

Thanks @martinbean, that makes so much sense! Jeffrey did touch upon the polymorph thing but didn't actually go into detail, but your explanation clears things up.

Will try it in my code tomorrow :) Thanks again!

Thyrosis started a new conversation Eagerloading Relationship, Maybe Polymorphic? • 3 months ago

Hi all,

I'm confused about something. I'm following along with Jeffrey's excellent Forum series, but am at the same time customising it to suit my needs (a roleplaying board). So, what I've done is this:

class User extends Model
    public function threads()
        return $this->hasMany(Thread::class);

So far, so good. A user can have many threads.

class Thread extends Model
    public function owner()
        return $this->belongsTo($this->user_type, 'user_id');

A thread, naturally, belongs to an owner. But, the owner is based on the user_type. Here's why:

class Character extends Model
    public function threads()
        return $this->hasMany(Thread::class, 'user_id');

Not only users, but also characters can create threads.

Now, I think I've taken a wrong turn somewhere. So far, all is working fine, I just query a relationship based on the user_type which has been stored to a thread. So the migration for Thread looks like this:

Schema::create('threads', function (Blueprint $table) {

My question is: I want to eagerload the owner of a thread, which isn't working. I'm sure I've missed the polymorphic bit, but I don't have a clue how to get this to work.

The reason I'm asking is that, on a page which shows a thread overview, of course you want it to show who started the thread. This is fine if you only have users, because then Laravel can include the thread.user_id = to the query.

But, for me to get the with('owner') to work, it needs to first know which thread.user_type is set (either App\Character or App\User) before it can do either thread.user_id = or thread.user_id =

Any pointers here? I've included code for which I think is needed to support my question, feel free to ask for more of course :)

Thyrosis left a reply on Laravel On Ubuntu • 3 months ago

For the record, your thinking process needs an update.

I can't even start to play around with Laravel I can't even get the welcome page to display. I'm ready to give up on Laravel and move to express or something because this is just not what I'm looking for. I chose Laravel because it's supposed to be "easier" and friendlier but to this point and I'm still at the very beginning it's proven not to be.

Do you realise that Laravel and Ubuntu/Homestead has absolutely nothing to do with each other? It's like saying "Boiling an egg is so difficult" if the reason for it being difficult is that you first have to install your gas cooker and you don't know how to attach the gas outlet to the cooker or something.

Sure, Homestead is named a lot because it's supposedly an easy way to run local development servers. Truth be told, I dabbled with them a few times. "I can do this", I said at the beginning of the day. I mean, I work at a webhosting company, I should be able to install a virtual server, right?

"I suck at this", I said at the end of the day. So the next morning I happily installed WAMPP, Composer and hey, let's start with Laravel.

So, my piece of advice: Don't let your first introduction with Laravel be spoiled by how you have to set up a virtual server which you've never done. If you get stuck on that part, just use the server/software you're used to using, whether it's WAMP, LAMP or MAMP. Only if you have started using Laravel, you're allowed to decide whether it's easy or not.

13th September, 2017

Thyrosis left a reply on Undefined Variable: Category (View: E:\Laravel\project2\resources\views\pages\category.blade.php) • 3 months ago

So, with your lack of code and information this is a long stretch, but...

Im guessing you're collecting your categories in your controller and storing it to $data['category']. Then in your view you expect $category to be accessible.

So far, so good. So either category is undefined in your view because it is actually not passed from the controller to the view, or because maybe you override it somewhere later.

Thyrosis left a reply on Send Email On User Registration • 3 months ago

You're connecting to port 2525 to connect with the Google mailservers, which is not accepted.

I'm pretty sure their settings should be port 465 and encryption SSL, but I could be wrong on that. Have a look at the Gmail documentation for remote SMTP connections for the correct settings.

Thyrosis left a reply on Laravel Vs Plan PHP With No Framework • 3 months ago

From personal experience I can tell you that switching over from plain old PHP to a framework seems like a hassle at the start. You need to relearn certain concepts and sometimes you're like "I could have done this so much quicker the old way".

But somewhere along the line of your first project (for me it was when I hit the point where I'd laid down the groundwork and was starting to delve deeper in the different pages, controllers and views etc), you'll come to realise that from that point, everything goes so much quicker and smoother.

It took me three tries (and three frameworks) to get my head around it. Started with Zend, then Symphony, they both failed miserably. Then I was introduced to CodeIgniter, which gave me my lightbulb moment. Switched to Laravel for the next project and haven't looked back since.

4th September, 2017

Thyrosis left a reply on Catching TokenMismatchExceptions In Handler • 3 months ago

@bashy I don't think it will. The instanceof will just check if the given object is an instance of a given class by checking the class and of the model against the name given.

It will not check if the given class and actually exists. For the instanceof check, its just a name, nothing more. That's why you need to import the class or use it's full path for this to work.

Thyrosis left a reply on File_get_contents Failed To Open Stream: Connection Timed Out • 3 months ago

Tell PHP to ignore the error by adding an @ symbol before the function call.

$data = @file_get_contents($burl, false, $context);

See the PHP documentation on for more info.

Thyrosis left a reply on Catching TokenMismatchExceptions In Handler • 3 months ago

To debug, as soon as you hit the render-method, dd($exception).

You're probably looking to match Illuminate\Session\TokenMismatchException, not just TokenMismatchException. Unless you import Illuminate\Session\TokenMismatchException of course.

Thyrosis left a reply on Mail Bcc • 3 months ago

It's pretty simple really. Don't send them in one go, but send them to each recipient individually.

Or, if you want to stick to using the bcc-option: Send the email to yourself first and then add all other recipients as bccs. So if your sending a news letter for instance, have the news letter sent to '[email protected]' and then add and as bcc recipients.

1st September, 2017

Thyrosis left a reply on Curl Error 7 : Couldn't Connect To Host • 3 months ago

Usually to do with some port restriction or firewall.

Why would you use guzzle for your mail though, instead of the mail library? Isnt guzzle used for http traffic?

25th August, 2017

Thyrosis left a reply on Create A CMS Backend With Laravel • 3 months ago

I would suggest starting with the beginner Laravel tutorials right here on Laracasts. The 'starting with Laravel 5.4' series lets you create a blog, and a dashboard is nothing more than a place where all the create and edit routes are collected.

11th August, 2017

Thyrosis left a reply on Following The Series Forum With Laravel And TDD • 4 months ago

It means you haven't set your allowed attributes to be mass assigned.

Easy fix, add this first in your model definition:

''' protected $guarded = []; '''

10th August, 2017

Thyrosis left a reply on Lets Encrypt Staging Ssl , Always Fail To Install • 4 months ago

The error LE returns is:

DNS problem: NXDOMAIN looking up A for

This means that for some reason, the A record staging.{yourdomain.ext} doesn't resolve properly (yet). When did you make the change in CloudFlare? DNS changes can take up to 24 hours to become active.

Thyrosis left a reply on How Many Of You Are Agree With The Idea That We Need Laracast Mobile App ? • 4 months ago

I do watch videos on my phone, mainly during short commutes which are ideal to (re)watch a single episode.

But to do so, the site is perfect the way it is. There is no need for an app when the developers/designers have spent this much attention to a mobile/responsive layout.

Also, if you wanted to watch videos while offline, just download them to your phone and watch them with your local video player. Its the whole point of the download option in the first place.

5th August, 2017

Thyrosis left a reply on Laravel 5.5 Minimum Requirements • 4 months ago

I'm pretty sure I read somewhere that MySQL 5.6 is the minimum version it'll run on, but now I can't find it anywhere.

Might have actually been while installing Laravel 5.5 on my PHP 5.6 server and it complaining about requiring PHP > 7.

But, upgrading your MySQL to 5.6 shouldn't be too much of an issue or cause upgrading issues. I've upgraded a lot of servers and haven't had any complaints yet.

4th August, 2017

Thyrosis left a reply on Sending Forms Bitween Users • 4 months ago

I don't have any experience with Envoyer, but isn't this just a case of storing the users form-answers in a database and pull them up when the admin views the user profile?

# Migration
class CreateFormsTable extends Migration
    public function up()
        Schema::create('subscriptions', function (Blueprint $table) {

# User class
class User
    public function forms()
        return $this->hasMany(Form::class);

# Form class
class Form
    public function user()
        return $this->belongsTo(User::class);

# Admin controller to show user profile
public function show(User $user)
    return $user->forms;

Thyrosis left a reply on Creating A Sub-Domain For Every Client And Providing An Inbound Email ID • 4 months ago

Ah, then you don't need subdomain mailaddresses at all.

When I get a mail from Asana, I reply to

So Asana only has to monitor that specific email address. The part before the @ is probably a unique hash given to each task, so that internally it'll fetch the local recipient part and find a task for it.

The same will be true for you. You could create one central e-mailaddress '[email protected]' to which you can set a catch-all too. Then, let your users send emails to {randomstring}, it will be delivered to your [email protected] This you can easily parse using the PHP IMAP functions @CodebyRay already mentioned.

Edit Your Profile

Want to change your profile photo? We pull from