teos_97

teos_97

Member Since 4 Months Ago

Experience Points
20,650
Total
Experience

4,350 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
190
Lessons
Completed
Best Reply Awards
1
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 5
20,650 XP
Apr
03
1 day ago
Activity icon

Replied to Updated From 6.* To 7.0

I was getting exactly the same error just now,

I changed the handler to accept instances of Throwable instead of Exception as per the documention, then in the sessions i changed the 'secure' default to null, cleared the cache in bootstrap/cache/ and run composer update. This fixed my issues

Activity icon

Replied to Consuming Your Web Api On Mobile

@bobbybouwmann I see but, then assuming that a user downloads the app and registers, the new user is created, how would I share the access token? Is there a passport method for this ? or Do make a request from the register controller to my api route to generate a token ?

Activity icon

Replied to Update Laravel

Try composer create-project --prefer-dist laravel/laravel blog "7.*"

Activity icon

Replied to Update Laravel

For installing a specific version you can use composer create-project --prefer-dist laravel/laravel blog "5.8.*"

For upgrading from 5.8 I would follow the docs. 5.8-> 6 https://laravel.com/docs/6.x/upgrade

And then 6-> 7 https://laravel.com/docs/7.x/upgrade

Activity icon

Replied to How To Get Limited Words In Laravel Blade And Get Like This 0-100 Words And 100-200 Words In Laravel

I’m not sure I understand the question but if you mean to limit the length of a text in a blade template, I use str_limit()

str_limit($text, $limit = 200, $end="..."); Like so, variable, amount of characters and ... after.
Activity icon

Started a new Conversation Consuming Your Web Api On Mobile

I hope this finds everybody well,

I am relatively new in the laravel community and for the past couple of months I have been building my final year computing project using laravel and so far it's been great ! Looking back, it is amazing what a journey has been and how many things I have learned from day 0 until now. Needless to say that a big part of this success has been thanks to the amazing tutorials on Laracasts and this community forum that has helped me with its vast discussion on common issues, but also on some more specific to my needs.

Back to the "Advice"... I have been researching different approaches on making my API available to mobile clients. Now I am not an expert, but I think so far, all the tutorials and threads I have found refer on using laravel in order to expose your API to third part applications.

My goal is to simply have two mobile applications and essentially "consume"my own api, given that the mobile client has authenticated via his username & passport, same thing that happens on the website.

I know many people would say, well that they could open the website on the browser and do their thing instead of having the website in an app, but nonetheless, I'd like to go that way for two reasons :

  1. I need to implement this as part of my final year project.

  2. It is always good to expose yourself to new things, get outside your comfort zone, learn and expand my skill set.

I hope that his sums it up, thanks for taking the time to read this and I am looking forward in suggestions on how would you go about creating this.

Thanks

Activity icon

Replied to Query Fetches Only 2 Records

Try selecting ‘fbId’ column as well, and probably do a where(‘fbId’, $request->id)

Activity icon

Replied to Query Fetches Only 2 Records

Hey could you dd the request object? Thx

Mar
30
5 days ago
Activity icon

Replied to Relationship For User Messages

@elanorriley thanks for putting me on the right track. I have solved it by looking into this type of relationship but I ended up getting empty collections, however through trial and error I have managed to get the results. The authenticated user retrieve a collection of all users that he has messaged or that they have messaged him, by defining this relationship :

public function contacts() { return $this->belongsToMany(User::class, Message::class, 'from', 'to', 'id' )->distinct(); }

Thank you very much for your help, I have marked your answer as "Best Answer", since it showed me where to look for a solution :)
Activity icon

Replied to Relationship For User Messages

I’d like to do it with relationships but if it might be easier to do a single sql query to get a collection of all users that have messaged the current user and the users that the current user has messaged, I wouldn’t mind it, since i will only need to run this once to load a list of users (contacts).

Activity icon

Replied to Relationship For User Messages

I played around with has many through but I get mixed results also my relationship in messages is hasOne, could you give me an example for the has many through messages that references the same model?(user)

Activity icon

Replied to Use Vue In Laravel Blade

In your blade template wrap the components that you want to be viewed only by the authenticated users. @Auth //components for authenticated users @endAuth

or the inverse for guests @Guest //Shown only to guests @EndGuest

Hope that helps

Activity icon

Started a new Conversation Relationship For User Messages

Hello and sorry for the confusing title, but I am stuck on something that might be easier to do with a pivot table, however I am hoping that someone here could help me get around it with my current setup.

I have a Users table and a messages table. The messages table has four columns. id, from, to and the text of messages.

I have also defined a relationship in the Messages the table to get all the messages from a user. (HasOne User class)

The problem is that I want to fetch all users that have messaged the authenticated user and all the users that the authenticated user has messaged.

To get the users that messaged the current user, currently I do the following: Querying the messages table where the from id = the auth id and the to = the auth id.

I could also query only the to id and eagerload the fromContact relationship to get the user models However my main concern is that I need a collection of User Model not a collection of message model.

I have a feeling that I approached it quite wrongly due to the amount of raw db queries i do, can somebody give me advice on a better approach/ solution thanks.

Mar
26
1 week ago
Activity icon

Started a new Conversation Pusher/Echo Real-time Messaging

Hello, this might sound strange, but I am extremely confused as to which of the thousands approach I should take to integrate a simple real-time messaging between users. Assuming you have two registered users, when one of them goes to the other users' profile, I want them him to be able to send a private message to that user.

The part I am complicating myself its that I want to experiment with real-time messaging to do this. So far I think I want to follow the pusher approach. I have followed their tutorial -> https://pusher.com/tutorials/chat-laravel and this works beautifully, but what would be the next step, to take this as a base, but to use it as described above, only between two authenticated users ? Any other suggestions on how you'd go creating something like this are welcome.

Thanks in advance

P.S - > Advice ways to group the conversation to allow for past messages between users to be viewed .

Mar
25
1 week ago
Activity icon

Commented on Node, Redis, And Socket.io

Can not thank you enough !

Mar
17
2 weeks ago
Activity icon

Awarded Best Reply on This Page Isn’t Working Laraproject.com Is Currently Unable To Handle This Request. HTTP ERROR 500

Looks like you need to give the right permission to your directories. Try this and let me know if it works. chmod -R 775 /var/www/laravel/app/storage

If it doesn’t try setting the permissions to the bootstrap/ cache folder as well 775 or 777.

Finally I would try php artisan view:clear

Mar
16
2 weeks ago
Activity icon

Replied to Advice On Relationships

P.S - Just out of curiosity, if i have a user with two applications for example.


>>> $user->applications
=> Illuminate\Database\Eloquent\Collection {#3439
     all: [
       App\Application {#3450
         id: 1,
         user_id: 548,
         job_post_id: 40,
         created_at: null,
         updated_at: null,
       },
       App\Application {#3440
         id: 2,
         user_id: 548,
         job_post_id: 41,
         created_at: null,
         updated_at: null,
       },
     ],
   }
>>> 

and I want to access the job_post fields, can I somehow chain it ? like $user->applications->jobPost ? or I have to look it up with a where clause, or eager load the application with the JobPost so I have access on all fields by calling $user->applications ? Is there a better way for this ?

Activity icon

Replied to Advice On Relationships

Sorry, stupid questions I am taking it back :D . I quickly tested this within tinker and it looks like its working as required, thank you very much for your help :)

Activity icon

Replied to Advice On Relationships

Great thank you for the quick reply @snapey, would this interfere with my current setup, since the jobPost model already has a relationship with User? I use this to have the creator of the JobPost .

 public function owner(){
        return $this->belongsTo(User::class, 'user_id');
    }
Activity icon

Replied to RESTful API

I am not an expert but Restful api can be built with laravel. Afteral Restrul its just a set of rules for your endpoints. As for the authentication with mobile devices I have seen people suggest Laravel Passport.

Activity icon

Replied to Dropdown Search

I was following the Let’s build a forum using TDD series by Jeffrey and there is a video he talks about implementing instant search. He also shows how to use Laravel scout and Algolia, which I loved and ended up using myself as its very powerful and extremely easy to implement. Have a look here -> https://laracasts.com/series/lets-build-a-forum-with-laravel

Episode 94

Activity icon

Replied to This Page Isn’t Working Laraproject.com Is Currently Unable To Handle This Request. HTTP ERROR 500

Looks like you need to give the right permission to your directories. Try this and let me know if it works. chmod -R 775 /var/www/laravel/app/storage

If it doesn’t try setting the permissions to the bootstrap/ cache folder as well 775 or 777.

Finally I would try php artisan view:clear

Activity icon

Started a new Conversation Advice On Relationships

Hello everyone, I hope this find you well !

I need some an advice on what would be the proper relationship between three models.

Job Post | Users | Applications

Assume that a user currently has Many Job Posts ( Can create job Posts). Job Posts therefore, belongTo the User.

Now the tricky part, I want a user to be able to apply on a job post and later I could display to the user who created the job post all applicants for a specific job post, but also to a single member all his applications.

Is the following correct to achieve this type of behaviour.:

JobPost hasMany Applications // Many applications from different users

Applications belongsTo a JobPost // BelongsTo or has One job post ? since there are many application from different user for a single JobPost

and finally,

Application belongsTo a User. //The applying user. User hasMany Applications //Assuming they are different JobPosts

I rewrote this post, hoping that I have explained the issue better than last time.

Thank you

Jan
04
3 months ago
Activity icon

Replied to CSRF Token Not Found

Yes sorry for the typo, I will have a look, thank you for your help ! I'm pretty sure it something stupid, I will take a break and come back to have a look with fresh eyes.

Activity icon

Replied to CSRF Token Not Found

Here is my view folder structure The error goes away in the threads views but persists in the other views and folders including login and register

Activity icon

Replied to CSRF Token Not Found

I have npm run dev and the watcher is on so I assume that it recompiles automatically, I just tried recompiling and its the same .

Activity icon

Replied to CSRF Token Not Found

All my views extend this app.blade.php the only thing i've written for scripts are the ones at the bottom and i js/app.js for the vue, beside this all the other scripts come with the template. Here is a link to the whole app.blade.php

https://www.codepile.net/raw/PQrzd5Qk.html

Activity icon

Replied to CSRF Token Not Found

I tried replacing the line with the one that worked in the console but the error persists, here is my

Activity icon

Replied to CSRF Token Not Found

It returned the meta tag !

Activity icon

Replied to CSRF Token Not Found

Thanks for the quick answer, it returns null

Activity icon

Started a new Conversation CSRF Token Not Found

I decided to change my template, but for some reason even though I have the same setup my homepage(ONLY) gives me the CSRF token is not found which comes from this if else statement in the bootstrap.js

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) { window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; } else { console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); }

The console error :

What I am using :

I have tried placing csrf_token in the meta tag and I can confirm it is there when . I inspect the page but the if still statement fails.

P.S -> I am using this script as well for my vue instances but it works on the old theme and not on the new one.

Dec
31
3 months ago
Activity icon

Replied to Codestar AWS

Thank you very much, great answers this will definitely solve my problem ! I am so glad I asked

Activity icon

Started a new Conversation Codestar AWS

Hello everyone, Firstly I would like to apologise for possibly posting this thread on the wrong channel. Secondly, a small introduction about myself, I am last year student working on my major computing project, which I have choose to build using Laravel and I can't express how helpful laracast is in helping me learn and build my project.

The project : Part of the project I build, includes a forum, so I have been following How to build a forum using TDD development course here on laracast.

The issue I am experiencing isn't related to the course itself, but it has to do with git and remote servers.

I am trying to essentially develop the project on my local machine, as I have been doing so far, but when I commit the changes to my github branch, I want to have a remote server that will pick-up on the repository changes from github and reflect the on the " public " server that I can access from anywhere.

I've found an article post that explains a way to do this using the bitnami LAMP stack and a VM Box, but I found that 'd have to change my current setup, which is something I'd rather avoid as I am quite comfortable with it.

Next, another "option" is to use Ec2 beanstalk but the problem is that I' d have to manually upload the changes? This from what I understood also requires that I updated my database config files, so that it uses the server superglobals that AWS RDB uses to manage the instance.

Lastly, the option that seems to incorporate everything I want is AWS codeStar. It provides a way of setting up a project and it also tracks commits from github or the aws code commit to update the changes on the instance.

I'd love if anyone has done a setup like. this before, to provide some guidelines about prerequisites that allow github to be connected to aws (currently it keeps giving me an error that the member user has to match a regex ), and also once you have it up and running, how do you go about running the migrations, env configs etc.

If there are other solutions you are using to achieve a similar setup, I would be greatful to read them. Thank you !

Dec
27
3 months ago
Activity icon

Commented on A User Can Filter By Unanswered Threads

I was wondering what is the difference between static::deleting and static::deleted ?

Dec
21
3 months ago
Activity icon

Commented on The Activity Deletion Bug

@spacedog4 If you are following the tutorial, just go to your RecordsActivity Trait and in the getActivityToRecord() method, change return ['created']; to return ['created' , 'deleted'] . Not that if you change it the test asserting that the activity is gone won't pass, however all the deletion activities will be recorded to to your activities table