Git Product home page Git Product logo

tweety's Introduction

Tweety

This is the repository for the "Laravel From Scratch" final project at Laracasts. Please feel free to fork it and learn from or expand however you wish.

Recommended Additions

  1. The profile page banner image and description are hard-coded. Make these dynamic for each user.
  2. Add the ability to attach an image when publishing a tweet.
  3. There is currently no way to unlike a tweet. Add the ability to toggle a like.
  4. Add a pop-up flash message when a user publishes a tweet or follows someone.
  5. Consider adding Laravel Livewire to allow for more interactive forms.
  6. When writing a new tweet, display the number of remaining characters they're allowed.
  7. Allow tweets to be deleted.
  8. Add support for mentions and notifications.
  9. Work on responsiveness.

tweety's People

Contributors

jeffreyway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tweety's Issues

a little help understanding the Likable trait

I've added parent_id to tweets as a means to include tweets as comments too.
I've added a parent() and children() method to the Tweet model

    public function children()
    {
        return $this->hasMany('App\Tweet', 'parent_id')->with('children');
    }

But when I add ->withCount('children') to the timeline() method it foobar's the ->withLikes() method. instead of a number for likes & dislikes I get json string of the likes array instead.
[{"id":1,"user_id":1,"tweet_id":50,"liked":1,"created_at":"2020-10-12T20:24:10.000000Z","updated_at":"2020-10-12T20:27:00.000000Z"},{"id":3,"user_id":2,"tweet_id":50,"liked":1,"created_at":"2020-10-12T20:24:29.000000Z","updated_at":"2020-10-12T20:24:29.000000Z"}]

My questions is, why does this happen? is it someinthg in the Likable trait that doesn't like the withCount or the possiblitiy is nesting? or other?

I know and appreiacite it is a little off-topic so any help would be cool.

How to avoid extra sql query for each tweet?

This example code produces one sql extra query for each tweet:

select * from "users" where "users"."id" = '1' limit 1

So for many tweets this will kill any database. I understand that this is just a "basic example", but I would say that avoiding unneccessary db queries belongs to the basic teachings that any new developer should learn - it is really important to not teach people wrong things, they will carry on with that for very long and it will hurt them eventually.

It would be great if you would like to add some information to your tutorial about how to cache queries or avoid them - also it will be a good thing for all the db admins around the world to produce new developers that do not produce code like this :) - thank you very much!

Debugging

In the "Build a Like/Dislike system" episode 67 of the series, in 22:23 timestamp, we start including the "like" and "dislike" buttons and im getting a Call to a member function where() on null this happens after I implement this on the _tweet.blade.php blade file

<div class="flex items-center {{ $tweet->isDislikedBy( current_user() ) ? 'text-blue-500' : 'text-gray-500' }}">

The error is actually being returned in line 4:

1.    public function isDislikedBy(User $user)
2.    {
3.        return (bool) $user->likes
4.            ->where('tweet_id', $this->id) 
5.            ->where('liked', false)
6.            ->count();
7.    }

How can I start knowing what's going on in or out from the isDislikedBy() ? What im thinking is that I should be back-engineering the source of that where function because what's inside of it, it's returning null. I noticed jeffrey doesn't ever references a Model, like for example, this: use App\Like and that happens in most of the files, where as I have had to do that in some Models. I know he's on Laravel 6 and Im wondering if in Laravel 8, the reason why it's returning null is because an endpoint somewhere isn't being referenced. Thanks! Awesome project.

login after registration not working.

Hi,
I'm finding I can't login following registration. would this be a know issues?

Install
Migrate
Register,
Logout
Login > "These credentials do not match our records."

is the validation and/or hasing correct?
*Needless to say that this user is indeed within the database and I am using the correct details.

2020/0927

TODO

フロントエンド

    • ふくろうが飛ぶアニメーション
    • サンプルフクロウの設置

バックエンド

    • 報告機能
    • 報告時のポップアップ
    • 返信機能
    • ログイン関係の機能(メール認証、パスワードを忘れた方はこちら)
    • mypageの履歴を24時間以内にする
    • 既読の耳マーク
    • 宝石のグレードアップ機能
    • 返信に対するありがとう機能 (編集済み)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.