Posts by Vagner do Carmo • 600 points
22 posts
-
4
votes1
answer106
viewsA: Failed to register a package created in Laravel 5.1
Vendor -> Intocavel Most likely you forgot to tell the Commodore to reindexe the namespaces: composer dump-autoload
-
0
votes1
answer501
viewsA: Laravel 5 - How to use Primary key in pivot table?
public function products() { return $this->belongsToMany('App\Product')->withTimestamps()->withPivot("id"); }
-
0
votes2
answers1023
viewsA: Route Post is not being recognized (Laravel)
Why do you need this ,] in the end? The problem may be because there is already another route for this action, Terrenocontroller@store which is also post, maybe you have set up a Route::Source and…
-
1
votes2
answers1208
viewsA: Import library to Laravel 5
I believe that the FPDF class does not belong to any namespace, so to use it you would have to map in Composer.json: "autoload": { "classmap": [ "database", "app/Libraries/FPDF" ] }, and in the…
-
1
votes2
answers263
viewsA: Laravel Belongstomany
I believe with solves your problem: Auth::user()->with("profiles", "profiles.areaItens", "profiles.areaItens.area") ->profiles->areaItens->toArray();…
-
2
votes1
answer788
viewsA: Problem with filters and routes in the Laravel
Try merging routes to the same Source in a new filter, for example Route::filter('auth.administrator_or_operator', function(){ $groups = ["administrator", "operator"];…
-
1
votes4
answers3795
viewsA: Filter results by logged-in user id
You can also use the Hasmany relation in the user model, considering that you have in the table products the key of the user (usuario_id) class Usuario extends Eloquent{ public function produtos(){…
laravelanswered Vagner do Carmo 600 -
0
votes4
answers3795
viewsA: Filter results by logged-in user id
You can use Auth to catch the user who has logged on to the system: if (Auth::check()){ //verifica se tem usuario logado $usuario_id = Auth::user()->id; $usuario_produtos =…
laravelanswered Vagner do Carmo 600 -
2
votes4
answers430
viewsA: PHP class for interaction with Mysql BD
If looking for solutions with ORM has PHP Active Record or Doctrine ORM…
-
0
votes2
answers1147
viewsQ: How to Inherit Models in Laravel 4
Whereas you have the Models Pessoa and Usuario, and that a Usuario is a Pessoa (Usuario extends Pessoa), or Usuario belongsTo Pessoa and Pessoa hasOne Usuario. It is possible that the Usuario has…
-
0
votes3
answers42780
viewsA: How to change date format in bootstrap from mm/dd/yyyy to dd/mm/yyyy
I believe the problem is happening because of the order of imports, try to import in this order: 1) datepicker.css 2) bootstrap-datepicker.js 3) bootstrap-datepicker.en-BR.js…
-
7
votes3
answers1012
viewsA: User Authentication with Laravel 4
You can create groups .. Route::group(array('before'=>'auth'), function(){ Route::get('/', 'HomeController@index'); Route::get('/hello', 'HomeController@showWelcome'); }); Official documentation…
-
0
votes2
answers1790
viewsA: Dynamic menu in Codeigniter
In your view, you should search the submenu for each menu... and configure the get_submenu method to pick only the submenus of the menu in question... <?php foreach ($menu_list->result() as…
-
0
votes1
answer237
viewsQ: SSH - Change the default session path
How do I start my SSH session in a specific folder instead of going to ~/ (/home/user_name/).
-
2
votes2
answers1433
viewsA: Laravel: View and Subviews
I usually use the method View::share("variável", "valor"); to share variables across all views... but I believe there should be better methods... ex.: //No controller public function minhaAction(){…
-
0
votes3
answers5915
viewsA: Struct and chained list
The problem was the conflict with your #Define Person... you can change the directive and put #ifndef __PESSOA_H__ #define __PESSOA_H__ // ... aqui seu código usando typedef #endif…
-
2
votes1
answer87
viewsA: PHP does not update file data . txt
Your code worked correctly here in my tests... session_name("TESTESPHP-CotadorVisitas"); session_start(); $counter = __DIR__."/counter.txt"; // verifica se o ficheiro existe. se não existe cria um…
phpanswered Vagner do Carmo 600 -
1
votes3
answers3859
viewsA: Count the columns of a Mysql table using PHP
You can use the show Columns, show columns from my_table; and then count the lines of the result ...
-
4
votes5
answers5334
viewsA: How to convert datetime to short date Brazilian model
You can also let javascript determine which format is best data = new Date("2014-06-16 21:56:29"); alert(data.toLocaleString()); //no navegador pt-BR vai dizer 16/6/2014 21:56:29…
-
5
votes2
answers579
viewsA: Pull PHP information via AJAX with jQuery in json format
If it is to generate JSON, PHP has the function json_encode(): $pessoa = array( "nome" => "Pessoa 1", "sobrenome" => "da Silva" ); echo json_encode($pessoa); // Vai gerar {"nome":"Pessoa 1",…
-
3
votes2
answers2257
viewsQ: How do I get the class name in a static context?
i want to get the name of the class that called my method class A { public static String getClass(){ return getCalledClass(); /*Supondo que exista esse metodo*/ } } class B extends A{ } When I do:…
javaasked Vagner do Carmo 600 -
1
votes2
answers2536
viewsA: Laravel - Accessing absolute directory path for download
Do you have a route called 'uploads'? If yes, this error may be happening because it does not access the file in the uploads folder, but tries to find the action of this route... There are no…