SCIF/propel-laravel

TODO. Wishlist

SCIF opened this issue · 5 comments

SCIF commented

Write your wishes which you want to be implemented in current package.

My own prefered task list:

  • write quick start guide (installation, database reverse/write schema, setup auth provider)
  • task that will change auth settings in app/

Stopped using a fork
Change namespace
Add Russian documentation
Write an article for the propel website
Create integration for the debugbar
Use the full configuration file
Make a command to create the sample schema
Upgrade to 5.1

SCIF commented

Stopped using a fork
Change namespace

It depends on Propel community decision about package status. If they will agree: will change ns and, may be place package in propel account.

Add Russian documentation

You can feel free to write it and do PR :) Or create just draft for it and i will complete it.

Write an article for the propel website

See answer on 1st and 2nd questions :) Not my area of responsibility.

Create integration for the debugbar

Are you about barryvdh's debugbar? It's interesting idea. Will inspect possibility of that.

Use the full configuration file

Will come soon.

Make a command to create the sample schema

That will be enlightened in quick start guide.

Upgrade to 5.1

Will finish it next week, i hope.

Upgrade to 5.2
Integration for route model binding

SCIF commented

@Snake231088 , yep, support of 5.2 will be added in few days (through that weekend). Idea about route model hinting is very interesting and seems useful. @Big-Shark , did you dig that area?

I've found this way to implement route model binding with Propel:
routes.php:

Route::get('/test/{user}', function(\Illuminate\Http\Request $request, \App\Models\Users $user) {
    dd($user->getEmail());
});

RouteServiceProvider.php

public function boot(Router $router)
    {
        $router->bind('user', function($value) {
            $user = UsersQuery::create()->findPk($value);
            if(!($user instanceof Users)) throw new NotFoundHttpException();
            return $user;
        });

        parent::boot($router);
    }

so when i pass var in route named user and this var contain a valid user id the bind return the correct user object.
But in this way it's not automatically resolved because you must write logic code in RouteServiceProvider.
Can you try to integrate this in PropelLaravel package?
You can get the model's name in the Models dir (propel model dir) and register bind for example.
I hope this is an help for you.
(I also hope you push in this weekend ;) )