Coder Social home page Coder Social logo

laravel-userstamps's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

laravel-userstamps's Issues

Laravel 8 Problem in Updating

Wasn't able to update to Laravel 8, what seems to be the problem?

Problem 1
- Installation request for sqits/laravel-userstamps ^0.0.7 -> satisfiable by sqits/laravel-userstamps[0.0.7].
- Can only install one of: laravel/framework[8.x-dev, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.0.0, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.0.1, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.0.2, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.0.3, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.0.4, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.1.0, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.2.0, 5.7.x-dev].
- Can only install one of: laravel/framework[v8.3.0, 5.7.x-dev].
- Conclusion: install laravel/framework 5.7.x-dev
- Installation request for laravel/framework ^8.0 -> satisfiable by laravel/framework[8.x-dev, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.2.0, v8.3.0].

Please support ulid in users_table_column_type

Please support ulid in users_table_column_type

  // \config\userstamps.php

  /*
   * Define the table column type which is used in the table schema for
   * the id of the user
   *
   * Options: increments, bigIncrements, uuid
   * Default: bigIncrements
   */

  "users_table_column_type" => "bigIncrements",

dont active the event and not register at field created_by

<?php


return [

    /*
     * Define the table which is used in de database to retrieve the users
     */

    'users_table' => 'users',

    /*
     * Define the mmodel which is used for the relationships on your models
     */

    'users_model' => App\HR\Auth\Users\User::class,

    /*
     * Define the column which is used in de database to save the user's id
     * which created the model.
     */

    'created_by_column' => 'created_by',

    /*
     * Define the column which is used in de database to save the user's id
     * which updated the model.
     */

    'updated_by_column' => 'updated_by',

    /*
     * Define the column which is used in de database to save the user's id
     * which deleted the model.
     */

    'deleted_by_column' => 'deleted_by',

];

<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableActionPlans extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create( 'action_plans', function ( Blueprint $table ) {
                $table->increments( 'id_action_plan' );
                $table->string( 'name', 160 );
                $table->string( 'description', 220 );
                $table->integer( 'archived' );
                $table->integer( 'history' );
                $table->integer( 'status' );
                $table->timestamps();
                $table->softDeletes();
                $table->userstamps();
                $table->softUserstamps();
            }
        );
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists( 'action_plans' );
    }
}

<?php

namespace App\HR\Metrics\ActionPlans;

use Illuminate\Database\Eloquent\Model;
use Sqits\UserStamps\Concerns\HasUserStamps;

/**
 * @property varchar                                  $name             name
 * @property varchar                                  $description      description
 * @property timestamp                                $created_at       created at
 * @property timestamp                                $updated_at       updated at
 * @property timestamp                                $deleted_at       deleted at
 * @property \Illuminate\Database\Eloquent\Collection $shasambassador   belongsToMany
 * @property \Illuminate\Database\Eloquent\Collection $shastask         belongsToMany
 * @property \Illuminate\Database\Eloquent\Collection $dimensionshass   belongsToMany
 * @property \Illuminate\Database\Eloquent\Collection $employeeshastask belongsToMany
 * @property \Illuminate\Database\Eloquent\Collection $measurehass      belongsToMany
 */
class ActionPlan extends Model
{

    use HasUserStamps;
    /**
     * Database table name
     */
    protected $table      = 'action_plans';
    protected $primaryKey = 'id_action_plan';

    /**
     * Mass assignable columns
     */
    protected $fillable
        = [
            'name',
            'archived',
            'history',
            'description',
            'status',
        ];

    /**
     * Date time columns.
     */
    protected $dates = [];


}

    public function store( StorePlanRequest $request)
    {
        $modelActionPlan = new ActionPlan();
        $modelActionPlan->fill($request->all());
        $modelActionPlan->save();

    } /**

save the register but not register the user :/ i check with debug a break-point the method and never stop the break-point :S

NOTE: created good the table with field and relations but dont register user

Not working in queue

I have a job to sent email to all users, after process sent email done, i update the data, but why column updated_by be null?

// app/Jobs/ProcessSendEmail.php

class ProcessSendEmail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * Create a new job instance.
     */
    public function __construct(protected Payroll $payroll)
    {
        //
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        try {
            Mail::to($payroll->email)->send(new PayrollEmail($payroll, true));

            Payroll::find($this->payroll->id)->update([
                'sent_at' => Carbon::now(),
            ]);
        } catch (\Exception $e) {
        }
    }
}

uuid not supported

if use uuid type for id, macros has error in registerUserstamps
SQLSTATE[42830]: Invalid foreign key: 7 ERROR: there is no unique constraint matching given keys for referenced table "users" (SQL: alter table "users" add constraint "users_created_by_foreign" foreign key ("created_by") references "users" ("id") on delete set null)

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {

671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|

  +9 vendor frames

10 database/migrations/2014_10_12_000000_create_users_table.php:30
Illuminate\Support\Facades\Facade::__callStatic("create")

  +35 vendor frames

46 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

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.