leostereo

leostereo

Member Since 8 Months Ago

Experience Points
4,700
Total
Experience

300 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
36
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
4,700 XP
Aug
15
1 month ago
Activity icon

Replied to Route Protection With Socialite

Hello !! This did not work:

Route::resource('device', ['middleware'=>'auth','uses'=>'DeviceController']);

But this works:

        public function __construct()
        {
            $this->middleware('auth');
        }

In the controller class. Thanks!!!

Aug
14
1 month ago
Activity icon

Started a new Conversation Route Protection With Socialite

Hi guys ... here i am trying to protect some of my routes. I m using socialite and it is already working ... so now , how should I protect my routes: For example. Those are my routes:

Route::get('/auth/redirect/{provider}', '[email protected]');

Route::get('/callback/{provider}', '[email protected]');

Route::redirect('/', '/login')->name('inicio');

Route::resource('device', 'DeviceController');

Auth::routes();

Route::get('/home', '[email protected]')->name('home');

I would like only authenticated user can access to: device.create route ...

Im reading about the auth middleeare , but im not sure if it is usefull here since im using socialite. please bring me some light.

Thanks Leandro

Aug
09
1 month ago
Activity icon

Started a new Conversation Laravel In A Docker ?

Hi guys , just would like to know if can recommend some easy to install and use docker image with out of the box laravel ready to use. I have been about laradock, is there another image to consider ? Thanks for the advices. Leandro.

Apr
05
5 months ago
Apr
04
5 months ago
Activity icon

Started a new Conversation Redirect Exceptions And Errors To File

Hi guys , im working on a telegram app. I already stablished comunication between my app and my laravel backend. Problem is that I have a very limited output on telegram screen when error occurs. For example I receibe this:

<!DOCTYPE html><!--___UnexpectedValueException: The stream or file

Which is not usefull for debug. Is there some way to redirect those messages to a filefor a better debug? There is nothing usefull on mi log files. Regards, Leandro.

Mar
29
5 months ago
Activity icon

Replied to Session Lifetime Question.

Dear Sti3bas , thanks for the response. Why do you consider better to use cache instead of session ? (never worked with any of them. My project is to build a telegram chat aplication , I will keep track fo conversation. I appreciate your advice on this. Leandro.

Activity icon

Started a new Conversation Session Lifetime Question.

Hi guys , Im learning about sessions in laravel. I declare these routes:

Route::get('session/get','[email protected]');
Route::get('session/set','[email protected]');

One to store and other to retrieve the session key. and this is the controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SessionController extends Controller
{

   public function accessSessionData(Request $request) {
        $value = $request->session()->get('key');
	return $value;
        //
    }
   public function storeSessionData(Request $request) {
        $value = $request->session()->put('key',date("Y-m-d H:i:s"));

        //
    }
}

Problem is that ... after first session->put, the stored key is never cleared. According to my .env , session lifetime is 120 (secconds I suppose).

[[email protected] api_chat]# grep SESSION .env
SESSION_DRIVER=file
SESSION_LIFETIME=120

But my key still there , allways calling at http://10.1.1.50/api_chat/public/index.php/api/session/get it returns for example: 2020-03-23 14:32:21 Shouldn`t key value be cleared autmatically after 120 seconds ?

Any thought would be wellcome. Regards. Leandro.

Mar
27
5 months ago
Activity icon

Replied to Can Not Store Session Value.

Thanks !!! It worked , I was working with api routes , so doing:

   protected $middlewareGroups = [
       'web' => [
           \App\Http\Middleware\EncryptCookies::class,
           \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
           \Illuminate\Session\Middleware\StartSession::class,
           // \Illuminate\Session\Middleware\AuthenticateSession::class,
           \Illuminate\View\Middleware\ShareErrorsFromSession::class,
           \App\Http\Middleware\VerifyCsrfToken::class,
           \Illuminate\Routing\Middleware\SubstituteBindings::class,
       ],

       'api' => [
           \Illuminate\Session\Middleware\StartSession::class,
           'throttle:60,1',
           'bindings',
       ],
   ];

btw ... looking at session documentation it does not mention anything about this line. Thankyou.

Activity icon

Started a new Conversation Can Not Store Session Value.

Hi guys , im running laravel 5.8. Im trying to set and get some session values but I got following message:

 RuntimeException
Session store not set on request.

This is my controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SessionController extends Controller
{
    /**
     * Show the profile for the given user.
     *
     * @param  Request  $request
     * @param  int  $id
     * @return Response
     */
   public function storeSessionData(Request $request) {
        $value = $request->session()->put('key');

        //
    }
}

I did not tweak anything else.

Any ideas ? Leandro.

Mar
26
5 months ago
Activity icon

Started a new Conversation Telegram Stateful Chat Bot Backend

Hi guys; I will begin workin in my new project , it is a telegram chat bot. I already have my webhook done and can send and receive single messages. Now I would like to create a "dialog" between my app and the bot. So I will I need to keep track of the message states. Any ideas ... good practices ? I think , I will need to use sessions while posting to my api ... is this ok ? Ok ... any thought would be welcome. Regards. Leandro.

Mar
24
5 months ago
Activity icon

Started a new Conversation Time Elapsed Between Database Registers.

Hi guys , Im learning about elocuent. In my current project db , I need to create a column with the elapsed time from previous inserted register to current insert. On other scenario , I would try to solve it using timediff function but now I would like to use elocuent. Is there any way to do it ? If not what should be my second choice ? query builder ?

Regards. Leandro

Activity icon

Replied to Getting Timestamp Weird Format

Hi shez1983. My version:

[[email protected]_Redes fichajes]# php artisan --version
Laravel Framework 7.2.2

It worked !!!! Thanks.

Mar
22
5 months ago
Activity icon

Started a new Conversation Getting Timestamp Weird Format

Hi guys, im facing a strange behaviour: Im retriving some timestamps stored on my db doing:

 $registers = Fichajes::all()->toArray();
 $msg="Registros: \n";

                        foreach($registers as $register){
                                $msg .= $register['created_at'].' '.$register['type']."\n";
                        }
        
return urlencode($msg);

If I look at my Fichajes table , it looks like:

+----+---------------------+---------------------+---------+--------+
| id | created_at          | updated_at          | user_id | type   |
+----+---------------------+---------------------+---------+--------+
|  3 | 2020-03-22 17:49:38 | 2020-03-22 17:49:38 |       7 | begin  |
|  4 | 2020-03-22 18:03:03 | 2020-03-22 18:03:03 |       7 | finish |
|  5 | 2020-03-22 18:25:18 | 2020-03-22 18:25:18 |       7 | salida |
+----+---------------------+---------------------+---------+--------+

But when I bring the data , they looks like:

2020-03-22T17:49:38.000000Z begin
2020-03-22T18:03:03.000000Z finish
2020-03-22T18:25:18.000000Z salida
2020-03-22T18:26:21.000000Z salida
2020-03-22T18:26:27.000000Z entrada

How can I avoid those '000000Z' strings on my data ? Regards. Leandro