Forum

How to mark up forum posts.

Markdown

Forum posts can be marked up in a number of ways. For one, it supports a basic Markdown implementation. Code blocks can be done by either indenting the code at least one level or by surrounding your code with three tilde characters alone on their own line.

Headers

Headers can be rendered with # signs as follow:

# A 1st level header
## A 2nd level header
### A 3rd level header
#### A 4th level header
##### A 5th level header

Paragraphs & Line-Breaks

Paragraphs can be created by using two enters after a sentence. Line breaks can be used by using two spaces after a sentence. The spaces are marked as dots.

This sentence is the first paragraph..
And the two spaces after the sentence above created a newline

This sentence is the second paragraph

Styling

Some basic styling can be used. Note that the inline code block styling uses backticks and not regular single quotes.

*This will be marked as italic*
**This will be marked as bold**
***This will be marked as italic and bold***
In this sentence the `code block` is styled differently

Which results in:

This will be marked as italic
This will be marked as bold
This will be marked as italic and bold
In this sentence the code block is styled differently

Lists

Lists can be created by using the following syntax:

- First list item
- Second list item
- Third list item.

Which results in:

  • First list item
  • Second list item
  • Third list item.

Links

Links can be marked up using the following syntax:

[This is a link](http://example.com)

Which results in:

This is a link

Images

Images can be marked up using the following syntax:

![Your alt text here](http://placephant.com/300/200)

Which results in:

Your alt text here

Code Blocks

Code blocks can be marked up using indentation by 4 spaces or a single tab. Spaces are marked as dots.

....function example() {
....  return 'This is an example';
....}

Code blocks can also be marked up by using the ~~~ characters:

~~~
function example() {
  return 'This is an example';  
}
~~~

Both examples above result in:

function example() {
  return 'This is an example';  
}

Gists

Gists can be embedded automatically by simply posting a gist URL. As follows:

driesvints
driesvints
  • 2 years ago

Nice to have this! Now, I just have to start learning markup finally. :(

Its really helpfull if team can integrate some markdown editor to textarea direcly in reply box :)

Code blocks are pain the ass. Add [code][/code] as normal bbcode.

RokSiEu said:

Code blocks are pain the ass. Add [code][/code] as normal bbcode.

You can also use three tildes "~~~" at the start and end of your code, instead of the code block method...

$foo = 'bar';
return View::make('foo')->with('foo', $foo);

Greetings people:

Im trying to use Hash class to encrypt my passwords, but I get the error Bcrypt hashing not supported. I am aware Laravel needs: PHP >= 5.3.7 MCrypt PHP Extension My wamp server has PHP5.4.12 and I already check that Mcrypt was enable, according to phpinfo(), it is enable; I also edit the index.php and load the phpinfo() there to see if the php version that laravel was loading was the correct one. In cmd i run php --ini and it load a lower php version that i have but i dont know how to change that.

Any sugestion?, I run out of ideas D:

@cemeai

Please start a new thread to request help, this topic is discussing the markup used by the forum.

For code blocks, you can also just indent the code with one tab (and make sure there is an empty line before/after the code) Can you also disable embedding a gist? Large gists aren't really cool to embed.

i have some problem to make routes in laravel, i have a package then i call from routes it is work fine but i want make it easy with automatic, so i put thi code

....Route::any('admin/(:any)/add/(:any?)', function($controller,$params=null) {
....  return Controller::call([email protected]', (array) $params);
....});

i want call controller with namespace then i change that script with this

....Route::any('admin/(:any)/add/(:any?)', function($controller,$params=null) {
....  return Controller::call("Ardani\\Smsgateway\\Controllers\\[email protected]", (array) $params);
....});

but error NotFoundHttpException, what wrong my code? i sorry my english not good. thanks before

@Ardani, please create your own topic.

Sometimes I'm having problems with enters not being picked up. Is this by design?

Note that inline code elements can still be written like on github:

To output properly formatted JSON, use `Response::json($data)`.

It will look like this:

To output properly formatted JSON, use Response::json($data).

No special formatting has been added, though. I suggest implementing that.

I just discovered that, if code doesn't get the desired syntax highlighting from the language detector, you can force it like this (similar to GitHub markdown):

~~~php
$html = '<img src="">';
~~~

As you see, the code above is not detected as PHP, as the markdown was intentionally put inside the code snippet. This instead is what happens when the markdown is parsed:

$html = '<img src="">';

I don't know but perhaps any Linguist language code could be used for language suggestion.

I have the feeling some is not working correctly with escaping output, in the quote section. See http://laravel.io/forum/02-22-2014-twitter-bootstrap-311-not-displaying-dropdown-items It doesn't render the comments, probably because in the quote_body, the html is shown and not escaped..

barryvdh said:

I have the feeling some is not working correctly with escaping output, in the quote section. See http://laravel.io/forum/02-22-2014-twitter-bootstrap-311-not-displaying-dropdown-items It doesn't render the comments, probably because in the quote_body, the html is shown and not escaped..

This has already been reported
http://laravel.io/forum/02-17-2014-thread-malformed-html

Also, take a look at this and have fun!
http://laravel.io/forum/02-17-2014-jquery-mobile-simple-form-route-does-not-work

Please check this for code and tables: http://laravel.io/bin/7l9B

I want to display 'Recent Comments' from comments table, including HotelName related to that Comments. which is working fine as my below query:

Comment::with('hotel')->where('active', '=', 1)->orderBy('created_at', 'DESC')->get();

Now i want to display TOTAL REVIEWS with each HotelName also, how can I do that?

I have been trying to get this table sortable. Here are the two classes:

First the page that has the table.

@extends('layouts.master')

@section('title')

@stop

@section('styles')

@stop

@section('header')
<h1>Average Grades</h1>
@stop

@section('content')


<?php $user = Sentry::getUser();
//Finds the current user ^^^
//echo $user['email'];

?>
<p><font size ='5'>Average Grade per User</font></p>
<?php $users = User::all();
 $evalID = DB::table('evaluations')->lists('id', 'id');
//$grades1 = DB::table('students')->lists('grades1', 'id');

?>


<!-- Table starts here -->

<div class="table-responsive">
 <table id="AverageGrades" class="table table-bordered table-groups" >

<thead>
 <tr bgcolor="Black">

                   <td><font color="White">First Name</td></font>
                   <td><font color="White">Last Name</td></font>
                   <td><font color="White">Email</td></font>

                   <td> <font color="White">Average Grade</td></font>

                     </td>



                       </tr>


@foreach ($users as $user)



<?php
//Current solutuion to the questionaire.
//$temp = DB::table('answers')->join('users', 'answers.answered_about', '=', 'users.id')
  //  ->avg('ans1', 'ans2')->where('users.id','=',$user->id)->get();
//$price = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans1', 'ans2', 'ans3', 'ans4');


$a1 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans1');
$a2 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans2');
$a3 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans3');
$a4 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans4');
$a5 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans5');
$a6 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans6');
$a7 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans7');
$a8 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans8');
$a9 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans9');
$a10 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans10');
$avg = ($a1 + $a2 + $a3 + $a4 + $a5 + $a6 + $a7 + $a8 + $a9 + $a10)/10;   //Averages all a1-a10
?>



                        <tbody>  
                         <tr bgcolor="#73000A">
                            <td><font color="White">{{$user->first_name}}</td>
                            <td><font color="White">{{$user->last_name}}</td>
                            <td><font color="White">{{$user->email}}</td>
                            <td><font color="White">{{$avg}}</td>  
                        </tbody>
                        </tr>
@endforeach  


</table>



@stop

Second the page that has jquery


@extends('layouts.master') @section('title') @stop @section('styles') @stop @section('header') <h1>Average Grades</h1> @stop @section('content') <?php $user = Sentry::getUser(); //Finds the current user ^^^ //echo $user['email']; ?> <p><font size ='5'>Average Grade per User</font></p> <?php $users = User::all(); $evalID = DB::table('evaluations')->lists('id', 'id'); //$grades1 = DB::table('students')->lists('grades1', 'id'); ?> <!-- Table starts here --> <div class="table-responsive"> <table id="AverageGrades" class="table table-bordered table-groups" > <thead> <tr bgcolor="Black"> <td><font color="White">First Name</td></font> <td><font color="White">Last Name</td></font> <td><font color="White">Email</td></font> <td> <font color="White">Average Grade</td></font> </td> </tr> </thead> @foreach ($users as $user) <?php //Current solutuion to the questionaire. //$temp = DB::table('answers')->join('users', 'answers.answered_about', '=', 'users.id') // ->avg('ans1', 'ans2')->where('users.id','=',$user->id)->get(); //$price = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans1', 'ans2', 'ans3', 'ans4'); $a1 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans1'); $a2 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans2'); $a3 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans3'); $a4 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans4'); $a5 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans5'); $a6 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans6'); $a7 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans7'); $a8 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans8'); $a9 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans9'); $a10 = DB::table('answers')->where('answered_about', '=', $user->id)->avg('ans10'); $avg = ($a1 + $a2 + $a3 + $a4 + $a5 + $a6 + $a7 + $a8 + $a9 + $a10)/10; //Averages all a1-a10 ?> <tbody> <tr bgcolor="#73000A"> <td><font color="White">{{$user->first_name}}</td> <td><font color="White">{{$user->last_name}}</td> <td><font color="White">{{$user->email}}</td> <td><font color="White">{{$avg}}</td> </tbody> </tr> @endforeach </table> @stop

Whenever returning join with the same column name, the first instance is ignored.

Expected to return permissions.name and roles.name from below.

DB Structure: roles table id || name

permissions table id || name || display_name

Join Table: permissions_roles id || permission_id || role_id

Failing query

$item = DB::table('roles')->join('permissions_roles AS pr', 'pr.role_id', '=', 'roles.id')
->join('permissions AS p', 'pr.permission_id', '=', 'p.id')->select('roles.name', 'p.name')->get();

// unexpected result

array (size=62) 0 => object(stdClass)[397] public 'name' => string 'create_archive' (length=14) 1 => object(stdClass)[398] public 'name' => string 'edit_archive' (length=12)

//parallel query

$item = DB::table('roles')->join('permissions_roles AS pr', 'pr.role_id', '=', 'roles.id')
->join('permissions AS p', 'pr.permission_id', '=', 'p.id')->select('roles.name', 'p.display_name')->get();

//result as expected array (size=62) 0 => object(stdClass)[397] public 'name' => string 'admin' (length=5) public 'display_name' => string 'create archive' (length=14) 1 => object(stdClass)[398] public 'name' => string 'admin' (length=5) public 'display_name' => string 'edit archive' (length=12)

/* DB Structure

Table: roles id || name

Table: permissions id || name || display_name

Join Table: permissions_roles id || permission_id || role_id

Failing query */

$item = DB::table('roles')->join('permissions_roles AS pr', 'pr.role_id', '=', 'roles.id') ->join('permissions AS p', 'pr.permission_id', '=', 'p.id')->select('roles.name', 'p.name')->get();

// unexpected result

array (size=62) 0 => object(stdClass)[397] public 'name' => string 'create_archive' (length=14) 1 => object(stdClass)[398] public 'name' => string 'edit_archive' (length=12)

//parallel query $item = DB::table('roles')->join('permissions_roles AS pr', 'pr.role_id', '=', 'roles.id') ->join('permissions AS p', 'pr.permission_id', '=', 'p.id')->select('roles.name', 'p.display_name')->get();

//result as expected array (size=62) 0 => object(stdClass)[397] public 'name' => string 'admin' (length=5) public 'display_name' => string 'create archive' (length=14) 1 => object(stdClass)[398] public 'name' => string 'admin' (length=5) public 'display_name' => string 'edit archive' (length=12)

How do I correctly write this query using raw expression please.

DB::table('table')->where(DB::raw( 'DATEDIFF(CURRENT_DATE, DATE(subDate)) >= ' . $dDay ))->where(DB::raw( 'lastMsg < ' . $msgId ))->get();

It currently produces 'select * from subscriber where DATEDIFF(CURRENT_DATE, DATE(subDate)) >= 2 is null and lastMsg < 7 is null'

I don't expect is null attached and a little confused.

Hello!

The model looks like this:

User->Value

Value->Category

Value->LocalValue

LocalValue->Value,Language

Question 1:

How to query LocalValues for a specific Language, and Values that belong to a certain category?

Question 2:

Where to place the method that returns the data in the model?

Or should this query go outside of the model?

Thanks!

Toby

some text