Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

How pre my code block in laravel?

How do I post text so that it is formatted as code?

What do I need to do so that my code shows up properly — escaped when posted? And how to get the correct syntax highlighting?

<pre><code>
         <?php namespace App\Http\Requests\Auth;
        use Illuminate\Foundation\Http\FormRequest;
    class RegisterRequest extends FormRequest {
                public function rules()
                            {
                    return [
                            'email' => 'required|email|unique:users',
                            'password' => 'required|confirmed|min:8',
                        ];
                        }
            public function authorize()
                    {
                    return true;
                        }
                    }

</code></pre>

Maybe take a look at a "syntax highlighter" to preview your code on your website: http://alexgorbatchev.com/SyntaxHighlighter/

I am having been struggled for couple of days...

Do I have to follow such as https://github.com/syntaxhighlighter/brush-php ? and dont understand.

I would have to give a space for

 "<" and "?php"

. but the codes show messing up. it does not in the order... How can I improve the codes?

I am making a very short video for example here is

https://www.youtube.com/watch?v=JLVooFb6EK4&feature=youtu.be

Take a look here: http://jsfiddle.net/16xj8udn/

Delete the <?php tag

Include the files to your head:

<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" /> <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script> <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>

and run the highlighter in the bottom on your page

<script type="text/javascript"> SyntaxHighlighter.all() </script>

Please read the docs ... -> http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html

Take a look at this snippet: http://jsfiddle.net/16xj8udn/1/

And take another jquery plugin -> http://balupton.github.io/jquery-syntaxhighlighter/demo/

This is working fine.

it was helpful. I learned about the

<?php 

have to be removed like you said . and it works thank you so much.