Support the ongoing development of Laravel.io →
posted 10 years ago
Laravel.io
Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

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);
Last updated 2 years ago.
0

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:

Last updated 2 years ago.
0

@cemeai

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

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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('admin.'.$controller.'@edit', (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\\Kirim@simplesms", (array) $params);
....});

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

Last updated 2 years ago.
0

@Ardani, please create your own topic.

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

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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-d... It doesn't render the comments, probably because in the quote_body, the html is shown and not escaped..

Last updated 2 years ago.
0

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-d... 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-r...

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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





Last updated 2 years ago.
0

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)

Last updated 2 years ago.
0
/* 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)

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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

Last updated 2 years ago.
0
Last updated 2 years ago.
0
echo "Hello World!";
Last updated 2 years ago.
0
</div>
Last updated 2 years ago.
0
Last updated 2 years ago.
0

#Hello World

0
$var = 1;
0

rizqidjamaluddin said:

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.>rizqidjamaluddin said:

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.