Coder Social home page Coder Social logo

blogify's Introduction

Blogify

Blogify is a package to add a blog to your Laravel 5 application. It comes with a full admin panel with different views for all user roles. You can generate the public part through an artisan command but feel free to customize it, or just create your own using or models and their scopes.

The documentation can be found on or website www.blogify.io

blogify's People

Contributors

awjudd avatar ericvanjohnson avatar exetico avatar hasnayeen avatar jorenvh avatar ramirovarandas avatar stevepop 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

blogify's Issues

SwiftMailer Error

When creating users, the BlogifyMailer service class attempts to send email but throws a Swift_TransportException, Cannot send message without a sender address

Can't Install

If I run : composer require jorenvanhocht/blogify 1.0-RC

This is the result:
Problem 1
- The requested package jorenvanhocht/blogify could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Migration Fails On Existing Project

The blogify:migration command fails if I already have the users table set up in my Laravel project. A better option would be to update the existing users table with the additional fields needed. The blogify migration scripts do not seem to reflect the password_resets table as well -- I'm assuming it uses the Laravel authentication mechanisms?

A possible solution might look like this (for the users table migration script):

    public function up()
    {
        Schema::table('users', function($table)
        {
            $table->string('firstname', 30);
            $table->string('lastname', 30);
            $table->string('username', 30)->unique();
            $table->string('profilepicture', 200);
            $table->integer('role_id')->unsigned();
            $table->foreign('role_id')->references('id')->on('roles');
        });
    }

    public function down()
    {
        Schema::table('users', function($table)
        {
            $table->dropForeign('role_id');
            $table->dropColumn('firstname', 'lastname', 'username', 'role_id', 'profilepicture');
        });
    }

I wouldn't mind ditching the username entirely and using the email as unique identifier, then showing the first_name and last_name or name (which could be used solely for display purposes as a substitute for username).

Wonder what the best way would be to handle already existing first_name and last_name fields in existing Laravel projects? You'd almost have to write a migration script that checks database fields to see what is already set up, but that gets dangerous real quick. In general, the first thing I do is remove name and add first_name and last_name fields as soon as I start a project, so all my existing projects are already set up with first and last names in this one form or another.

ProtectedPost fails when the post doesn't exist

Line 56 in the ProtectedPost middleware fails when the post is not found. What this should be doing instead is checking to see if they post exists, if it doesn't, redirect you to a custom 404 page, or back to the main blog page with an error message for the user.

It should avoid the issue if you change the code to the following:

if ($post->count() == 1 && $post->visibility_id == 2) {
}

Views not generated

Hi,

When I run "php artisan blogify:generate", the views are not being generated. Any idea as to why this is happening?

Thank you.

Dependency Not Automatically Installed

I had to run composer require jorenvanhocht/tracert 1.3-RC manually before running composer require jorenvanhocht/blogify 1.0-RC, as otherwise the package installation would fail.

Including sources. Prettify installation

IMHO. You need to include your resources folder with source sass and js files. And, instead of
php artisan blogify:migrate
php artisan blogify:seed
Move them to
php artisan vendor:publish
So, that developer can edit migrations and seeders exactly for their own project, for example, i already have role table with full permissions integrations.
Also, there is no need in git watching of public folder

Traceert error still exist

Composer gives this error when trying to install blogify.

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for jorenvanhocht/blogify v2.0 -> satisfiable by jorenvanhocht/blogify[v2.0].
- jorenvanhocht/blogify v2.0 requires jorenvanhocht/tracert v1.3-RC@dev -> satisfiable by jorenvanho cht/tracert[v1.3-RC] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

Problems with Laravel 5.2

I did :
$ php artisan blogify:migrate

and i got this error :

[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared()

so i replace :
$this->app->bindShared('form', function($app)
by
$this->app->singleton('form', function($app)
in vendor/illuminate/html/HtmlServiceProvider.php line 49

then I did :
$ php artisan blogify:migrate

I have now this error :

[ErrorException]
Array to string conversion

I search on the web but i didn't find any solution.

If you know how to fix this, thanks !

Migration Issue

I tried setting this up on my mac at home running PHP 7.
When running php artisan blogify:migrate I got the following error;

 [ErrorException]
  Array to string conversion

So I got the stack trace below by adding -v to the command;

 php artisan blogify:migrate -v


  [ErrorException]
  Array to string conversion


Exception trace:
 () at /Users/steve/devapps/ultimate-blog/vendor/jorenvanhocht/blogify/database/Migrations/2015_03_03_212000_create_users_table.php:104
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at /Users/steve/devapps/ultimate-blog/vendor/jorenvanhocht/blogify/database/Migrations/2015_03_03_212000_create_users_table.php:104
 CreateUsersTable->{closure}() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:146
 Illuminate\Database\Schema\Builder->create() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:219
 Illuminate\Support\Facades\Facade::__callStatic() at /Users/steve/devapps/ultimate-blog/vendor/jorenvanhocht/blogify/database/Migrations/2015_03_03_212000_create_users_table.php:114
 CreateUsersTable->createUsersTable() at /Users/steve/devapps/ultimate-blog/vendor/jorenvanhocht/blogify/database/Migrations/2015_03_03_212000_create_users_table.php:27
 CreateUsersTable->up() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:147
 Illuminate\Database\Migrations\Migrator->runUp() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:117
 Illuminate\Database\Migrations\Migrator->runMigrationList() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:86
 Illuminate\Database\Migrations\Migrator->run() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:76
 Illuminate\Database\Console\Migrations\MigrateCommand->fire() at n/a:n/a
 call_user_func_array() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
 Illuminate\Container\Container->call() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
 Illuminate\Console\Command->execute() at /Users/steve/devapps/ultimate-blog/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
 Illuminate\Console\Command->run() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:185
 Illuminate\Console\Command->call() at /Users/steve/devapps/ultimate-blog/vendor/jorenvanhocht/blogify/src/Commands/BlogifyMigrateCommand.php:50
 jorenvanhocht\Blogify\Commands\BlogifyMigrateCommand->fire() at n/a:n/a
 call_user_func_array() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
 Illuminate\Container\Container->call() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
 Illuminate\Console\Command->execute() at /Users/steve/devapps/ultimate-blog/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
 Illuminate\Console\Command->run() at /Users/steve/devapps/ultimate-blog/vendor/symfony/console/Application.php:791
 Symfony\Component\Console\Application->doRunCommand() at /Users/steve/devapps/ultimate-blog/vendor/symfony/console/Application.php:186
 Symfony\Component\Console\Application->doRun() at /Users/steve/devapps/ultimate-blog/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /Users/steve/devapps/ultimate-blog/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
 Illuminate\Foundation\Console\Kernel->handle() at /Users/steve/devapps/ultimate-blog/artisan:35

The issue seems to be in Line 104 of the create_users_table.php migration.

Migration on users table update

When running php artisan blogify:migrate I get a Not null violation: 7 ERROR: column hash contains null values. Basically, existing users in my users table have no hash which prevents the migration from running.

Routes

Hi,how to know the routes?

Or the basic functionality?

Thanks!

Tracert Config Bug

After running php artisan vendor:publish I get the error Can't locate path: </home/steve/sandbox/laravel-blog/vendor/jorenvanhocht/tracert/src/../config>

On looking at your TracertServiceProvider I can see in the following code where you are trying to publish the config but that path is wrong as there is no 'tracert/config' directory although I can see that you are merging the config file in 'tracert/Config/'

// Publish the config file
        $this->publishes([
            __DIR__.'/../config' => config_path(),
        ], 'config');

I hope this helps in understanding the issue.

Permission Denied Errors

On the commands artisan blogify:generate --namespace="Foo" and artisan blogify:create-dirs I get the following error:

[ErrorException]            
  mkdir(): Permission denied

route:list command error

[ php artisan route:list ] gives following error
[ErrorException]
Trying to get property of non-object

Seed Fails If App Namespace Is Already Set

The problem is that the seed class references App/User. Instead you will want to get the config variable, like so:

    public function run()
    {
        $user = App::make(Config::get('auth.model'));
        $user->create([
            'hash'          => blogify()->makeHash('users', 'hash', true),
            'lastname'          => $this->admin['name'],
            'firstname'     => $this->admin['firstname'],
            'username'      => $this->admin['username'],
            'email'         => $this->admin['email'],
            'password'      => Hash::make($this->admin['password']),
            'role_id'       => $this->admin_role,
            'created_at'    => Carbon::now(),
            'updated_at'    => Carbon::now()
        ]);
    }

Running the "blogify:generate" command fails

I've been trying to run the BlogifyGeneratePublicPartCommand and it keeps failing trying to mkdir. After going through it, it appears as though the second parameter (the $mode), isn't being passed in correctly.

error when trying to seed

Hi.

The process of installation seems ok.
But I get an error when trying to seed: artisan blogify:seed
This is the error:

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Model' not found

Thanks
Michel.

Wrong key in many-to-many relationship

In Tag model the key order is wrong in post method ,
return $this->belongsToMany('jorenvanhocht\Blogify\Models\Post', 'posts_have_tags', 'post_id', 'tag_id');
which should be
return $this->belongsToMany('jorenvanhocht\Blogify\Models\Post', 'posts_have_tags', 'tag_id', 'post_id');

Trailing slashes ajax requests

I just noticed that when I deployed the demo to blogify.io that I get a status code 301 on the ajax request for the auto save and for uploading a image for a post.

The problem seemed to be a trailing / in the request url's. For the stable release I will look for a solution to handle this so both are accepted (trailing slash or no trailing slash) so that every server configuration can handle the request.

Error Installing Package

I have just done a fresh Laravel installation and following your documentation, I executed composer require jorenvanhocht/blogify v2.0
I encountered the following error from composer,

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for jorenvanhocht/blogify v2.0 -> satisfiable by jorenvanhocht/blogify[v2.0].
    - jorenvanhocht/blogify v2.0 requires jorenvanhocht/tracert v1.3-RC@dev -> satisfiable by jorenvanhocht/tracert[v1.3-RC] but these conflict with your requirements or minimum-stability.


Installation failed, reverting ./composer.json to its original content.

Error After Fresh Install

Getting the following error after installing with Laravel 5.1.x (was trying to run artisan vendor:publish, but composer update fails with this as well):

Call to undefined method jorenvanhocht\Blogify\Facades\Blogify::isDeferred()

Include Vanilla Classes In Package Instead of Extending Them in the App Namespace

There are various references to the App namespace throughout the package. Instead of extending the App\Http\Controllers\Controller it might be better to include the vanilla controller in your plugin directly, thus you don't need to rely on the App namespace, or hope that the underlying project doesn't have an altered vanilla Controller class.

The Requests class is another one like this.

vendor:publish gives "Can't locate path"

Everytime I try to publish the files to the frontend I get the following errors.

Can't locate path: </var/www/html/laravel/vendor/jorenvanhocht/blogify/src/../Views/mails/resetpassword.blade.php

I am using Laravel 5.1

halnex@ubuntu:/var/www/html/laravel$ sudo php artisan vendor:publish
Can't locate path: </var/www/html/laravel/vendor/jorenvanhocht/tracert/src/../config>
Copied Directory [/vendor/jorenvanhocht/blogify/config] To [/config/blogify]
Copied Directory [/vendor/jorenvanhocht/blogify/public/assets] To [/public/assets/blogify]
Copied Directory [/vendor/jorenvanhocht/blogify/public/ckeditor] To [/public/ckeditor]
Copied Directory [/vendor/jorenvanhocht/blogify/public/datetimepicker] To [/public/datetimepicker]
Can't locate path: </var/www/html/laravel/vendor/jorenvanhocht/blogify/src/../Views/admin/auth/passwordreset/>
Can't locate path: </var/www/html/laravel/vendor/jorenvanhocht/blogify/src/../Views/mails/resetpassword.blade.php>
Publishing complete for tag []!

Going to http://localhost/laravel/public/admin/ works just fine, I am able to login and add new blog posts, even though it seems some javascript is not working. For example you can't add a category or tag while writing the article.

But going to http://localhost/laravel/public/blog/ gives this error

ReflectionException in Container.php line 736: Class App\Http\Controllers\BlogController does not exist

Migration issues with Laravel 5.2

I am getting this error when running php artisan blogify:migrate with a fresh install of Laravel 5.2

[ErrorException]
Array to string conversion

Install error

composer require jorenvanhocht/blogify v2.0
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for jorenvanhocht/blogify v2.0 -> satisfiable by jorenvanhocht/blogify[v2.0].
- jorenvanhocht/blogify v2.0 requires jorenvanhocht/tracert v1.3-RC@dev -> satisfiable by jorenvanhocht/tracert[v1.3-RC] but these conflict with your requirements or minimum-stability.

Installation failed, deleting ./composer.json.

Any way to fix it?

Possible VerifyCsrfToken Solution

I have a project with a similar need, where I needed to "whitelist" Ajax calls from Csrf. The solution I used was to update the Middleware with the required ruleset, instead of replacing the Csrf Middleware completely (as this may cause other issues if an existing project already uses customized Csrf middleware.

So my original VerifyCsrfToken middleware:

class VerifyCsrfToken extends BaseVerifier {

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        return parent::handle($request, $next);
    }
}

Became:

class VerifyCsrfToken extends BaseVerifier {

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
            if ($request->is('mixpanel/webhooks/*')) {
                return $next($request);
            }

        return parent::handle($request, $next);
    }
}

Where mixpanel/webhooks/* is the "namespace" in the routes that handles all my Ajax calls for this particular item.
This way only the web hook endpoints are left "exposed", not compromising the entire app. :)

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.