Added UserEvent.php
This commit is contained in:
parent
0d221c8439
commit
fb65c1b9fc
|
@ -286,7 +286,7 @@ class UserController extends Controller
|
||||||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
|
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
|
||||||
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
|
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
|
||||||
"</tr>";
|
"</tr>";
|
||||||
$users = DB::table('users')->where('name_first', 'LIKE',$request->search.'%')
|
$users = User::query()->where('name_first', 'LIKE',$request->search.'%')
|
||||||
->orWhere('name_last','LIKE', $request->search.'%')
|
->orWhere('name_last','LIKE', $request->search.'%')
|
||||||
->orWhere('phone','LIKE', $request->search.'%')
|
->orWhere('phone','LIKE', $request->search.'%')
|
||||||
->orWhere('email','LIKE',$request->search. '%')->get();
|
->orWhere('email','LIKE',$request->search. '%')->get();
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class UserEvent extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
|
@ -13,13 +13,13 @@ class CreateResourceCategories extends Migration
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::create('resource_categories', function (Blueprint $table) {
|
/*Schema::create('resource_categories', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->string("name")->unique();
|
$table->string("name")->unique();
|
||||||
$table->text("description");
|
$table->text("description");
|
||||||
$table->string("slug")->unique();
|
$table->string("slug")->unique();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateUserEventsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('user_events', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->integer("user_id")->unique();
|
||||||
|
$table->integer("event_id")->unique();
|
||||||
|
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->foreign("user_id")->references("id")->on("users");
|
||||||
|
$table->foreign("event_id")->references("id")->on("events");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('user_events');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue