Giter VIP home page Giter VIP logo

laravel-tricks's People

Contributors

assertchris avatar cborgia avatar cojocaru avatar jash-ash avatar jbruni avatar kolyaio avatar mattstauffer avatar mizix avatar msurguy avatar neeraj1005 avatar remo avatar stidges avatar thomashenley avatar yhbyun 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  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

laravel-tricks's Issues

Question: use Illuminate\Support\Facade\Str;

Hi again,

I have one more issue, don't know if its a bug.
After a fresh install on the project, I tried to save as admin a new tag or category, and I get : Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Illuminate\Support\Facade\Str' not found

I fixed it by changing in the Tagrepository.php from: use Illuminate\Support\Facade\Str; -> use Illuminate\Support\Str;

Not yet very advanced in all this Facades stuff but would be interesting to know why this error happened and if others also get it.

Thank you.

New Form Fields and Database Table Columns

Hello Guys,

I created new form fields in the settings area (settings.blade.php).

I also added the new data to the UsersTableSeeder.php like so:
[
'username' => 'kwame',
'email' => '[email protected]',
'password' => Hash::make('password'),
'city' => 'London',
'country' => 'UK',
'descriptiom' => 'I am a PHP developer based in London',
'is_admin' => '1'
]

What else do I have to do to make this work properly (and create columns) so that I can seed the new data into it?

What am I missing? I hope someone can help me solve this.

Question: public resources

Hi authors,

Sorry, could be a dummy question but still I don't get it. Why are the names of resources like URL::asset('css/laratricks.min.4.css') , include '.4' in the name. Should I rename them manually, is there some automatic way like a command.

Thx in advance. And thx for sharing.

Why two lines instead of one?

1 - original

    public function findAllForUser(User $user, $perPage = 9)
    {
        $tricks = $user->tricks()->orderBy('created_at', 'DESC')->paginate($perPage);

        return $tricks;
    }

2 - edited

    public function findAllForUser(User $user, $perPage = 9)
    {
        return $user->tricks()->orderBy('created_at', 'DESC')->paginate($perPage);
    }

Move text into "lang" directory

What do you guys think about using the "lang" directory? That would make it easier to translate and white-label this project.

Question: function in repository but not in interface

So I'm still learning about interfaces and using the repository pattern in Laravel. My question is whether the controller should be calling a method on the repository that is not present on that repository's interface. For example, in the UserTricksController, we call getEditForm on the Trick repository (line 122):

$form  = $this->trick->getEditForm($trick->id);

The getEditForm method is not present on the TrickRepositoryInterface, however, but it is on the TrickRepository.

User types

Hi,

I saw in config such option:

// available user permission types that are matched by user_type column in the users table
'user_types' => array(
    'admin'     => 100,
    'reviewer'  => 20,
    'user'      => 10
),

but no management for this, are there any plans for implementing this?

Refactor storeViewedTrick/getViewedTricks

These methods (and similarly named ones) are present in both Tricks\Events\ViewTrickHandler and Tricks\Filters\ViewThrottleFilter. Perhaps a trait or repository should be used to eliminate the repetition.

Fatal Error Exception after install

followed the instructions to install locally on windows and the following exception is provided:-
...
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class Tricks\User contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (Illuminate\Auth\UserInterface::getRememberToken, Illuminate\Auth\UserInterface::setRememberToken, Illuminate\Auth\UserInterface::getRememberTokenName)
...

Move like button

It took me a bit of time to find the like button, it would be nice if it was more visible within the post.

Unique category slug

Hi,

When I try to save a category with the same name , because the slug has to be unique I get an Illuminate \ Database \ QueryException .

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'aaa' for key 'categories_slug_unique' (SQL: insert into categories (name, slug, description, order, updated_at, created_at) values (aaa, aaa, aaaa, 4, 2014-03-09 19:57:16, 2014-03-09 19:57:16))

I will try to fix this in one fork soon, so if it will not be fixed meanwhile will propose a pull request, thx.

Eloquent methods in controllers

Per twitter discussion with @msurguy, these should be extracted into a repository:

UserTricksController lines 150-152:

$trick->tags()->detach();
$trick->categories()->detach();
$trick->delete();

TricksController line 80:

$voted = $trick->votes()->whereUserId($user->id)->first();

TricksController line 84:

$user = $trick->votes()->attach($user->id, [
    'created_at' => new \DateTime,
    'updated_at' => new \DateTime
]);

TricksController line 91:

$trick->votes()->detach($voted->id);

TricksController line 95:

$trick->save();

Help: Github login fail

Hi,

I just try to run a local copy of laravel-tricks on my laptop.
Everything looks fine (ex. register, login, create trick), but only fail on login with github.

When login with github, the page will redirect to '/login/github' with code & state get params.
And show "Argument 1 passed to Tricks\Repositories\Eloquent\UserRepository::createFromGithubData() must be an instance of League\OAuth2\Client\Provider\User, instance of League\OAuth2\Client\Entity\User given, called in .../app/Tricks/Services/Social/Github.php on line 95 and defined"
(The screenshot has attached)

I had setup 'clientId', 'clientSecret' and 'user_agent' correctly in app/config/social.php, but can't find out how this error happen.
Any suggestions would be greatly appreciated! Thanks!

screen shot 2014-06-18 at 10 32 57 pm

Error while migrating

I got the source and was trying to boot up the app. While trying to migrate, I got the following error:

PHP Warning: require(/home/myuser/Development/php/laravel-tricks/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/myuser/Development/php/laravel-tricks/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/myuser/Development/php/laravel-tricks/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/myuser/Development/php/laravel-tricks/bootstrap/autoload.php on line 17

Am I missing a file?

Login github fail

I have installed laravel tricks, league/oauth2-github, created github app with id and secret key. After login successfully on github, it callback to my website and this error is appear. What's my problem? Thanks for help!
laravel

Comments count 0 in Card View

Could you please share the code regarding getting the count from disqus for each trick in card view. Currently it is hardcoded as 0.

Thanks in advance

php artisan migrate and db:seed exception no such file or directory??

─[yuchao@localhost] - [~/htdocs/tricks] - [2014-09-25 04:08:49]
└─[210] <> php artisan migrate

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

migrate [--bench[="..."]] [--database[="..."]] [--path[="..."]] [--package[="..."]] [--pretend] [--seed]

┌─[yuchao@localhost] - [~/htdocs/tricks] - [2014-09-25 04:08:54]
└─[210] <> php artisan migrate --path="./app/database/migrations/"

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

migrate [--bench[="..."]] [--database[="..."]] [--path[="..."]] [--package[="..."]] [--pretend] [--seed]

please send me the sql file about the tricks ,thanks ,my email is: yuchao86 at gmail dot com.

[Proposal] To port the application to Laravel 5.2.10

The application is using the older version of the Laravel framework. The idea is to study the application completely and rewrite most of the part to leverage the latest Laravel framework as this stands as a good well structured application where many developers study and learn good practises from. Moreover being a big fan of laravel-tricks.com and learning a lot from that I think it would be great to update the codebase to the newer framework version.

Class 'User' not found in admin/users

Getting /admin/users route throws a FatalErrorException.

Route: /admin/users

FatalErrorException
Class 'User' not found

Template: app/views/admin/users/list.blade.php

<h1>Showing all users ({{User::count()}})</h1>

Namespacing the class does work:

<h1>Showing all users ({{Tricks\User::count()}})</h1>

Thanks!

Having problems installing on windows

Hi,

I've been trying to install this using wamp and haven't been having any luck. I'm redirected to site unavailable. Any help would be greatly appreciated!

Installation problems using "laravel/framework": "4.1.*"

I'm trying to install the app project files using composer and it seems that for some reason Laravel version 4.1 is no longer accessible from the composer installation. Its possible to confirm this? Or maybe I'm doing something wrong. In the mean time, I change composer's Laravel requirement to 4.2 and the installation runs smoothly.

Model relationship table question.

Hi ,

I have one question that is not only specific to this project but you also used it, so maybe you can shortly help me or point to some resource.
I can figure out how the pivot table tag_trick is managing the many to many relationship.
I found in Trick model the : protected $with = [ 'tags', 'categories', 'user' ]; (which is related to eager loading), and the standard belongsToMany methods, but I am wondering is this enough to create a new pivot table? e.g. subcategories, is it enough to set the belong to relationship, and laravel itself is managing it?

In short how the application knows about pivot table tag_trick?

thanks in advance, and if its off topic you can close it.

Feature: Google Login

Right now, it's a bit confusing, when you want to comment, you can log in using your google account, but not using your github account while you can only use github to log in to create a trick.

If we'd support google in both places, one would at least not have to use two different accounts on one site...?

[Proposal] Add a List View

Instead of looking at all the items through out the page i'd rather just see a list. Would be awesome if you could implement such a feature, so that user can decide whether he wants the items as a grid or listed as a list.

Bug : total tricks count in user public profile view

I think that total tricks count shows wrong number in user public profile view. At line 24 in app views/user/public.blade.php file,

<tr>
    <th>Total tricks:</th>
    <td>{{ count($tricks) }}</td>
</tr>

It shows not total tricks number but tricks count in one page. I think it should be changed as follows.

<tr>
    <th>Total tricks:</th>
    <td>{{ $tricks->getTotal() }}</td>
</tr>

The similar bug appears in the next Last trick. It shows last posting date in one page, but I have no good idea to fix this bug.

<tr>
    <th width="140">Last trick:</th>
    <td>{{ $user->lastActivity($tricks) }}</t
</tr>

I hope this will help your coding.

edit avatar image error

While editing avatar image from profile, it is responding with Server Internal Error. As per my debug analysis, i found that particular image file is not being sent, or it is giving error as file not found exception. Can any one help me on that.

Feature: Make the Post View right meta box "sticky"

I'd like to see the meta box on the post page as a "sticky" box, meaning it will stick to the top of the page when you scroll. This will help keep the information in view.

May help solve this problem as well: #5

Test

Could you upload also your tests?

Feature: Make intro text Markdown

I would like to see the intro text for a post to allow Markdown. When I recently posted something, It took my paragraphs and smashed them all together into one big paragraph. At the very least, can we get some nl2br() going on?

bad asset file names

I was always thinking I'm doing something wrong but now that I'm working on it again and still don't understand it, I really wonder what I'm missing.

There a file called [email protected] in this directory. https://github.com/CodepadME/laravel-tricks/tree/master/public/img. However, when I look at the code https://github.com/CodepadME/laravel-tricks/blob/master/app/views/partials/navigation.blade.php#L12 I only see a reference to [email protected].

I renamed a bunch of files when I first deployed it to my site, but I'd like to be able to pull changes from the official repository which isn't possible anymore due to a number of differences.

Post title change updates URL slug

I think it would be better if the URL slug did not update with the title of the post. If a user posts a trick, then later on changes the title, the anyone linked to that page will break.

I propose one of a few options:

  1. Disable updating or URL slug. Once it's created, it's set (This could be seen as a bad feature though)
  2. Use a unique ID of some kind instead (I think this was mentioned elsewhere...)
  3. Somehow keep track of the changes and have a redirect to the new URL (This could be overkill)

Thoughts?

What is 'access_token_secret' good for?

As far as I can see, nothing has changed in this area, but on my new box, I can't get github login working because I get this error:

Field 'access_token_secret' doesn't have a default value

This field is never set and isn't nullable either. What's the purpose of this field? I'm sure I'm missing something, seems to happen quite often to me these days 🚶

GitHub.php: Invalid argument supplied for foreach()

screenshot 2014-07-14 17 43 26

Experiencing Invalid argument supplied for foreach() when I attempt to register with GitHub. Here is the function:

/**
 * Get the primary, verified email address from the Github data.
 *
 * @param  mixed $emails
 * @return mixed
 */
protected function getPrimaryEmail($emails)
{
    foreach ($emails as $email) {
        if (! $email->primary) {
            continue;
        }

        if ($email->verified) {
            return $email->email;
        }

        throw new GithubEmailNotVerifiedException;
    }

    return null;
}

Whoops, looks like something went wrong.

The installation was successful. When you open the site - this error: Whoops, looks like something went wrong.

Predis\Connection\ConnectionException
…/­vendor/­predis/­predis/­lib/­Predis/­Connection/­AbstractConnection.php141

Predis \ Connection \ ConnectionException
Connection refused [tcp://127.0.0.1:6379]

  • Helper method to handle connection errors.
    *
    • @param string $message Error message.
    • @param int $code Error code.
      */
      protected function onConnectionError($message, $code = null)
      {
      CommunicationException::handle(new ConnectionException($this, "$message [{$this->parameters->scheme}://{$this->getIdentifier()}]", $code));
      }

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.