Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstnorris's avatar

Guidelines for posting on Laracasts.com

I have started this thread for everyone to favourite and share with others when the OP doesn't conform to, well, these guidelines. They are not meant to be hard and fast rules but as the title suggests, guidelines. If we all start on the same page then it is much easier to help one another.

If you're completely new here then I suggest taking a few minutes to read over this post before posting anything yourself. You won't always need to include examples from all of the information contained here but it is a good starting point.

Before you start

Try running composer dump-autoload -o (It's like turning your computer off and on again, it works wonders!)

Have you already looked?

Most things can be solved with a quick Google search, if you want to see if your question has already been asked then search the forums using Google by adding this before your search term:

site:laracasts.com/discuss

Don't hijack an existing thread

For things like Feature Requests, and Simple opinionated discussion this is ok. But for "How To" and "Code Review" type questions please start your own. Of course, where appropriate reference the existing question but do start your own thread. The reason being that it can become confusing very quickly as although you might have the same problem, you may not require the same solution. (Experience Points* can only be awarded to one person although multiple people may already be helping out; but this is beside the point. Just start a new thread; it avoids confusion.

How do I ... (v5.1.0, v5.0.32, v4.2.*)

Give it a meaningful title, include clearly what version of Laravel you are using.

Note: To see which version of Laravel you're using excatly, execute the following command within your project. It's the first thing to be printed out.

php artisan --version

Are you using Homestead?

No? Why not? Oh ok, well, if you're not, please say what you're using instead; MAMP, WAMP, XAMPP etc.

Which OS

Tell us what operating system you're using as your host machine; are you using Mac OS X (10.10.4), or Windows 8, Windows 7, or a Linux box?

Choose the right Channel

Jeffrey spent a long time deciding what channels to include to make it easier for us to help one another so lets keep up that trend.

"Tips" is for posting tips to share with the community, not for asking for tips on how to do something.
"Site Improvement" is for bugs/improvements to the Laracasts.com website. Not yours.
"Requests" is for lesson requests not requests for help.

Stick to one question

When asking for help, as this guide explains, keep it concise and to the point. Try to keep it to just one question per post. Similar to the S in SOLID, a post should contain only one question. When it is answered, mark it as so and if you need to follow up and you start to deviate far from the original, ask a new question.

Look at the bigger picture

The XY problem is asking about your attempted solution rather than your actual problem. This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

Please state clearly and concisely what it is you're trying to achieve, many of us are good at looking at code and finding bugs within it however a lot of the time your lives could be made simpler by taking advantage of a feature of Laravel that you're unaware of. Concentrate on your end goal and we'll try our best to help you with the rest.

See The XY Problem for more information.

Be specific

Honestly, we can't help you if you're not specific. All too often great answers are given and then the OP specifies some other constraint. (Worse if they say later down the line that their using a different version of Laravel). Yes, you could say, the guys helping out shouldn't assume, but come on, give us a break, we're helping you. So help us.

Errors and Exceptions

Firstly, if you receive one of these, I feel bad. It's horrible. But you can help yourself. Copy and paste the error message into your text editor and strip out all of the personal stuff that would only be shown on your machine.

For example, the following exception, when put into Google yielded No results. (Thats ZERO results).

[ErrorException]
Argument 2 passed to Illuminate\Mail\Mailer::send() must be of the type array, null given, called in /home/vagrant/Code/laravel/app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 216 and defined

From the above, the location of the file in /home/vagrant/Code/laravel/app/ is specific to my installation. If I remove that part and leave it as:

[ErrorException]
Argument 2 passed to Illuminate\Mail\Mailer::send() must be of the type array, null given, called in vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 216 and defined

I got many more results that are likely to help me.

Likewise, with these somewhat more generic errors, a quick Google search yielded some useful topics.

Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:

If that doesn't help, come back here and ask a question.

  1. Copy and paste the Exception. (see style guide below)
  2. Copy and paste the code from any file that the error relates to. (see style guide below)

Provide code

When asking a question, provide your code. Don't waste your time typing it out. Copy & paste it, the reason for this is when you type it out you are more likely to make small spelling mistakes and other simple syntax errors which is misleading. Anyone answering your question will always try to point these out when in actual fact they may not be the issue, you might have just typed it out wrong. So avoid it. If you happened to have a mistake or syntax error in your code, then at least that is an issue that we can solve.

An even better way is to copy it and paste it into SublimeText or your editor of choice and tidy it up so that it is nicely formmated. Then when you come to include it in your question, you can do so very easily by wrapping it within ```. Do you like looking at badly formatted code? Neither do we.

External Resources

Markdown Basics
GitHub Flavored Markdown

Example One: Basic

```
<?php
public function doSomething() {
    return $this->doesSomethingElse();
}
```

This will be rendered like so:

<?php
public function doSomething() {
    return $this->doesSomethingElse();
}

Example Two: Syntax Highlighting

To add syntax highlighting, just add the language after the three backticks like so.

```php

<?php namespace App;

class User extends Model {
    
    protected $fillable = [
        'name',
        'email'
    ];

    public function profile()
    {
        return $this->hasOne('App\Profile');
    }
    
}

Note

Make sure that you close your code tags

Document that code

Tell us what we're looking at. If you look at most of my questions and responses on here you will see that I utilise <h3> tags a lot alongside the <small> tag. It works great!

How

<h3>User <small>model</small></h3>

Example

User model

Verified Middleware

PagesController controller

Ok, I guess this one is over doing it, but, it is nice to be explicit and get in the habit.

Database schema

Tell us the structure of your database:

  1. Are you sticking to the naming conventions?
  2. What is the column type? int, string, text, boolean?
  3. Provide Markdown Tables or a link to Laravel Schema Designer.

Using a third-party package?

If you're using a third-party package, include a link to the GitHub repository and the appropriate documentation to which you have already been referring to. It saves us from having to search for it. (This helps as many packages share very similar names, so make sure we're looking at the right one!)

Links

To add a link you can use the normal <a> but that's long winded. Try square brackets to house the link text like so [link to url] followed by the (actual url in parentheses).

[ Link to url ]( http://laracasts.com ) Note remove the extra whitespace, I had to add it to show you the syntax.

Including images (where appropriate)

I recommend using a service like imgur. You can very easily upload images to their site and once you've done that, they will provide you with standard links directly to those images. Then you can include them as you would normally with the standard HTML IMG tag

Is it homework?

Let us know if it is homework or not. Simple.

Do not BUMP

With the exception of this thread which you are all welcome to bump at all times so to keep it on the front page ;)

If your question hasn't got any responses from any of us, there will be a reason. It isn't that we haven't seen it. By this I mean don't simply reply with the word Bump or similar, instead add a new reply and supply more information, that will in turn put you back on the front page.

  1. Start from the beginning, what are you trying to achieve?
  2. What have you tried?
  3. Where are you stuck?
  4. Follow all the points I've already mentioned above and we'll do our best to help.
  5. If too much time has passed you may not be able to edit your original post, that's ok. Add a new reply and supply all the details listed here.

No +1s

Well, as it is currently not possible to "thumbs up" the original post, I guess it is acceptable for there to be one "+1" or similar, form then on, people should "thumbs up" that reply otherwise what could be a conversation; it just turns into a long mess of "+1" and "me too!".

Be polite

This forum is not a commercial platform. As such contributions from other users to help you on your code issues or advice on how to solve "complications" are done as an unpaid effort by these users. As such, respect that someone actually did take time to open the thread, read your question and type out an answer.

There isn't much else to say here.

Accept answers

If someone has taken the time to help you out, the least you can do is show your appreciation by marking it as solved. To do this just click the check/tick ✓ mark. Do not mark your own response as answered unless you've actually taken the time to format a correct answer, you won't gain experience points either.

Replying and answering

I feel that this is just as important as the original post. When replying to someone don't just blindly give them an answer, let's all be good developers and ask more questions. The 5 Whys spring to mind.

Ultimately, if the OP isn't forthcoming with information, ask them questions, if not for them, for all the others who find the thread months/years down the line.

Always provide links to the Laravel Docs specific to the version number that the OP is using (hopefully these won't change). This is because the Laravel documentation is some of the best out there and it is only getting better. When you give an answer and show it alongside examples from the documentation, other's will think to look there first, it is also a gentle introduction to the documentation for some people too.

Things of interest

Thank you

Honestly, thank you. If you made it this far I salute you. Please share with others by copying the link below.

[Guidelines](https://laracasts.com/discuss/channels/general-discussion/guidelines-for-posting-on-laracastscom)

This is still in development so I will try to add more as your suggestions and edits come in.

0 likes
79 replies
beznez's avatar

@mstnorris +1 This is a great resource for new users. I'd also add showing effort. Showing that you've done your own work and you've taken steps encourages people to help. A user's first step should be documentation and research instead of posting a question.

2 likes
isimmons's avatar

"Do not BUMP If your question hasn't got any responses from any of us, there will be a reason. It isn't that we haven't seen it"

May be true for you guys who are constantly active on the forum but I've noticed many questions get pushed off the first page within minutes so I see nothing wrong with just one daily bump. Actually posting what new research you have done or what you've tried on your own as a reply to your own question is a good way to add information to the question and bump it to the top at the same time.

An example of choosing the right channel: "Tips" is for posting tips to share with the community, not for asking for tips on how to do something.

1 like
mstnorris's avatar

@isimmons that is what I mean. I will clarify that above. What I meant was don't just say BUMP. Usually a good question will get at least one reply, if it doesn't and is quickly pushed to the second/third page then, as unfortunate as that is, I suggest adding new information as I mentioned above.

Update

Done. :)

3 likes
frezno's avatar

This is a great resource for new users.

right - but for being 'visible' to the user it would have to be sticky otherwise it will get lost

mstnorris's avatar

@frezno I agree, and maybe @JeffreyWay could make it so.

But, that's why I wrote:

I'm hoping that this thread gets so much attention that it always remains at the top so anyone new or unfamiliar with this forum can have something to reference.

Anyway, if we we to bookmark it then we can share the link with others when there is the need.

anon12822's avatar

This is brilliant, make the post clear and concise with as much information!

+1 Bravo.

1 like
AliMalik's avatar

Very good guidelines , there must be a top two or so posts that always remain at the top. good for reference.

2 likes
bashy's avatar

Someone finally made this post!

Jeffrey should add a link to this thread in the modal of the "Start a Conversation".

mstnorris's avatar

@bashy thank you. I had been meaning to do it for months and finally got round to it today after helping out on a few threads where I thought the OP could have done with reading something like this.

bashy's avatar

:)

Just a note for the headings (H3/small), you could provide the markdown used maybe? Just the number of hashes I guess

davorminchorov's avatar

We need a new feature: Sticky threads! and Request this thread to be a sticky thread!

Good job! This is a nice thread!

1 like
mstnorris's avatar

@Ruffles thank you very much :)

To everyone who has looked at this post so far and given me positive feedback, thank you. I do ask though, is there anything you'd like me to include or amend, or even remove?

luoshiben's avatar

This post is a another excellent example of why Laravel (and generally, PHP) will continue to remain strong: community. I've worked with a lot of different technologies and finding other like-minded people to give and receive help to/from is not always what it should be. Here's a huge thank you to everyone who contributes in positive ways, and a special thanks in this case to @mstnorris! Well done.

1 like
bashy's avatar

@mstnorris Yes I gathered you used the h3 and small tags but they could be removed/escaped at some point (since they're HTML markup, not markdown). I suggest adding the 3/4 hashes for the sizing as well? :)

mstnorris's avatar

@bashy How do I do that? I can only get the ### Heading to work and not the <small> tag.

bashy's avatar

Yeah not sure about small but who wants to do small?

small?
###### small?
mstnorris's avatar

I like it when you're defining what your code represents; such as models, controllers, migrations. Yes, most of these are self explanatory but I think it looks tidier when all are explicitly defined. It's just personal preference, but I think others might like it too.

anon12822's avatar

@mstnorris I have to agree with you here, it's just a nice addition. It just looks cleaner.

Users Model

// Blah
1 like
bashy's avatar

True, long as it doesn't get removed ;)

1 like
Kryptonit3's avatar

@mstnorris php artisan --version works a bit better than just php artisan. No need to scroll up.

1 like
pmall's avatar

Great thread @mstnorris !

I suggest we should advice the users to describe what they want to achieve instead of their piece of code which doesn't work. I see a lot of threads with users wanting to do something that can be easily done with a laravel feature they doesn't know. But they are focusing on a small bug in their code instead of looking at the bigger picture.

2 likes
mstnorris's avatar

@pmall and @JarekTkaczyk I've added the "Look at the bigger picture" section. Please do let me know if you think the wording needs changing.

pmall's avatar

@mstnorris wording is cool :)

@JarekTkaczyk great link, it is exactly the way I would have explained it if I were more comfortable with english.

1 like
Next

Please or to participate in this conversation.