-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This battle station is now fully operational
- Loading branch information
1 parent
0fd48fb
commit dd1ba57
Showing
9 changed files
with
430 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace UnrulyNatives\Attitudes; | ||
|
||
|
||
// use Illuminate\Auth\Authenticatable; | ||
// use Illuminate\Auth\Passwords\CanResetPassword; | ||
// use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; | ||
// use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | ||
// use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; | ||
// use Illuminate\Database\Eloquent\Model; | ||
// use Illuminate\Foundation\Auth\Access\Authorizable; | ||
// use App\Role; | ||
// use Laraveldaily\Quickadmin\Observers\UserActionsObserver; | ||
// use Laraveldaily\Quickadmin\Traits\AdminPermissionsTrait; | ||
// use Spatie\Permission\Traits\HasRoles; | ||
|
||
trait Attitudes | ||
|
||
{ | ||
// use Authenticatable, Authorizable, CanResetPassword, AdminPermissionsTrait, HasRoles; | ||
|
||
|
||
|
||
public function importances() { | ||
return $this->hasMany(\App\Models\Userattitude::class, 'creator_id'); | ||
} | ||
|
||
public function attitudes() { | ||
return $this->hasMany(\App\Models\Userattitude::class, 'creator_id'); | ||
} | ||
|
||
|
||
public function user_approach($user) | ||
{ | ||
return $this->morphMany(\App\Models\Userattitude::class, 'item')->where('creator_id', ($user ? $user->id : NULL))->first(); | ||
} | ||
|
||
|
||
|
||
public static function boot() | ||
{ | ||
parent::boot(); | ||
|
||
// User::observe(new UserActionsObserver); | ||
} | ||
|
||
public function getAllattitudescountAttribute() { | ||
|
||
return "testing if the package is correctly integrated"; | ||
} | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/attitudes_migrations/2016_09_15_223905_create_un_a_quotations_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateUnAQuotationsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('un_a_quotations', function (Blueprint $table) { | ||
$table->increments('id'); | ||
|
||
|
||
$table->longText('text'); | ||
$table->string('author', 128); | ||
|
||
// these two will come in handy in later development of this package | ||
$table->integer('language_id')->unsigned()->nullable()->default(null); | ||
$table->integer('author_id')->unsigned()->nullable()->default(null); | ||
|
||
$table->integer('creator_id')->unsigned()->index('creator_id')->nullable()->default(null); | ||
$table->integer('updater_id')->unsigned()->index('updater_id')->nullable()->default(null); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
$table->integer('status')->nullable()->default(null); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
|
||
Schema::dropIfExists('un_a_quotations'); | ||
|
||
} | ||
} |
Oops, something went wrong.