From 7053316d8f2c67e606715c96e562b42aed6ba6c1 Mon Sep 17 00:00:00 2001 From: Shubham Kishan Date: Thu, 7 Mar 2024 10:50:36 +0530 Subject: [PATCH 1/2] new feature --- .env.example | 49 ------- app/Http/Controllers/ProjectController.php | 107 ++++++++++++++ app/Models/Project.php | 17 +++ app/Models/ProjectController.php | 107 ++++++++++++++ database/factories/ProductFactory.php | 29 ++++ ...020_12_31_080627_create_projects_table.php | 33 +++++ ...084959_associate_companies_individuals.php | 9 +- ...1_05_26_124648_create_associates_table.php | 12 +- database/seeders/ProjectTableSeeder.php | 76 ++++++++++ resources/views/projects/create.blade.php | 48 +++++++ resources/views/projects/edit.blade.php | 49 +++++++ resources/views/projects/index.blade.php | 93 ++++++++++++ resources/views/projects/layout.blade.php | 15 ++ resources/views/projects/show.blade.php | 29 ++++ resources/views/welcome1.blade.php | 132 ++++++++++++++++++ routes/web.php | 8 +- 16 files changed, 754 insertions(+), 59 deletions(-) delete mode 100644 .env.example create mode 100644 app/Http/Controllers/ProjectController.php create mode 100644 app/Models/Project.php create mode 100644 app/Models/ProjectController.php create mode 100644 database/factories/ProductFactory.php create mode 100644 database/migrations/2020_12_31_080627_create_projects_table.php create mode 100644 database/seeders/ProjectTableSeeder.php create mode 100644 resources/views/projects/create.blade.php create mode 100644 resources/views/projects/edit.blade.php create mode 100644 resources/views/projects/index.blade.php create mode 100644 resources/views/projects/layout.blade.php create mode 100644 resources/views/projects/show.blade.php create mode 100644 resources/views/welcome1.blade.php diff --git a/.env.example b/.env.example deleted file mode 100644 index bd67861..0000000 --- a/.env.example +++ /dev/null @@ -1,49 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack -LOG_LEVEL=debug - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=laravel -DB_USERNAME=root -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=database -SESSION_LIFETIME=120 - -MEMCACHED_HOST=127.0.0.1 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=mailhog -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS=null -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php new file mode 100644 index 0000000..6a90a7c --- /dev/null +++ b/app/Http/Controllers/ProjectController.php @@ -0,0 +1,107 @@ +paginate(5); + + return view('projects.index',compact('projects')) + ->with(request()->input('page')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('projects.create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + project::create($request->all()); + + return redirect()->route('projects.index') + ->with('success','Project created successfully.'); + } + + /** + * Display the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function show(project $project) + { + return view('projects.show',compact('project')); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function edit(project $project) + { + return view('projects.edit',compact('project')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function update(Request $request, project $project) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + $project->update($request->all()); + + return redirect()->route('projects.index') + ->with('success','Project updated successfully'); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function destroy(project $project) + { + $project->delete(); + + return redirect()->route('projects.index') + ->with('success','Project deleted successfully'); + } +} diff --git a/app/Models/Project.php b/app/Models/Project.php new file mode 100644 index 0000000..2d6f8ea --- /dev/null +++ b/app/Models/Project.php @@ -0,0 +1,17 @@ +paginate(5); + + return view('projects.index',compact('projects')) + ->with(request()->input('page')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('projects.create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + project::create($request->all()); + + return redirect()->route('projects.index') + ->with('success','project created successfully.'); + } + + /** + * Display the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function show(project $project) + { + return view('projects.show',compact('project')); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function edit(project $project) + { + return view('projects.edit',compact('project')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function update(Request $request, project $project) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + $project->update($request->all()); + + return redirect()->route('projects.index') + ->with('success','project updated successfully'); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function destroy(project $project) + { + $project->delete(); + + return redirect()->route('projects.index') + ->with('success','project deleted successfully'); + } +} diff --git a/database/factories/ProductFactory.php b/database/factories/ProductFactory.php new file mode 100644 index 0000000..12b186a --- /dev/null +++ b/database/factories/ProductFactory.php @@ -0,0 +1,29 @@ + $this->faker->name, + 'detail' => $this->faker->text(200) + ]; + } +} diff --git a/database/migrations/2020_12_31_080627_create_projects_table.php b/database/migrations/2020_12_31_080627_create_projects_table.php new file mode 100644 index 0000000..e54d4a8 --- /dev/null +++ b/database/migrations/2020_12_31_080627_create_projects_table.php @@ -0,0 +1,33 @@ +id(); + $table->string('name'); + $table->string('detail'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('projects'); + } +} diff --git a/database/migrations/2021_05_11_084959_associate_companies_individuals.php b/database/migrations/2021_05_11_084959_associate_companies_individuals.php index 606f2b1..040b971 100644 --- a/database/migrations/2021_05_11_084959_associate_companies_individuals.php +++ b/database/migrations/2021_05_11_084959_associate_companies_individuals.php @@ -14,18 +14,20 @@ class AssociateCompaniesIndividuals extends Migration public function up() { Schema::create('associate_companies_individuals', function (Blueprint $table) { - //$table->id(); $table->bigIncrements('id'); $table->unsignedBigInteger('user_id'); $table->foreign('user_id')->references('id')->on('users'); $table->string('name', 100); $table->enum('type', ['company', 'individual']); $table->string('phone'); - //$table->binary('logo'); $table->text('description'); $table->timestamps(); }); - DB::statement("ALTER TABLE associate_companies_individuals ADD logo MEDIUMBLOB"); + + // Adding the logo column as BLOB after table creation + Schema::table('associate_companies_individuals', function (Blueprint $table) { + $table->binary('logo')->after('description')->nullable(); + }); } /** @@ -35,6 +37,7 @@ public function up() */ public function down() { + // Dropping the table if it exists Schema::dropIfExists('associate_companies_individuals'); } } diff --git a/database/migrations/2021_05_26_124648_create_associates_table.php b/database/migrations/2021_05_26_124648_create_associates_table.php index a4df820..670910b 100644 --- a/database/migrations/2021_05_26_124648_create_associates_table.php +++ b/database/migrations/2021_05_26_124648_create_associates_table.php @@ -15,12 +15,12 @@ public function up() { Schema::create('associates', function (Blueprint $table) { $table->id(); - $table->string('name'); - $table->string('type'); - $table->string('address'); - $table->string('email'); - $table->('phone1'); - $table->('phone2'); + $table->string('name'); + $table->string('type'); + $table->string('address'); + $table->string('email'); + $table->string('phone1'); // Added 'string' to specify data type + $table->string('phone2'); // Added 'string' to specify data type $table->timestamps(); }); } diff --git a/database/seeders/ProjectTableSeeder.php b/database/seeders/ProjectTableSeeder.php new file mode 100644 index 0000000..037efc0 --- /dev/null +++ b/database/seeders/ProjectTableSeeder.php @@ -0,0 +1,76 @@ + 'Product #1', + 'detail' => 'Product #1 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #2', + 'detail' => 'Product #2 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #3', + 'detail' => 'Product #3 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #4', + 'detail' => 'Product #4 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #5', + 'detail' => 'Product #5 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #6', + 'detail' => 'Product #6 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #7', + 'detail' => 'Product #7 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #8', + 'detail' => 'Product #8 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #9', + 'detail' => 'Product #9 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #10', + 'detail' => 'Product #10 details' + ]); + $product->save(); + } +} diff --git a/resources/views/projects/create.blade.php b/resources/views/projects/create.blade.php new file mode 100644 index 0000000..388fac5 --- /dev/null +++ b/resources/views/projects/create.blade.php @@ -0,0 +1,48 @@ +@extends('projects.layout') + +@section('content') +
+
+
+

Add New Project

+
+
+ Back +
+
+
+ +@if ($errors->any()) +
+ Whoops! There were some problems with your input.

+ +
+@endif + +
+ @csrf + +
+
+
+ Name: + +
+
+
+
+ Detail: + +
+
+
+ +
+
+ +
+@endsection diff --git a/resources/views/projects/edit.blade.php b/resources/views/projects/edit.blade.php new file mode 100644 index 0000000..83baa8f --- /dev/null +++ b/resources/views/projects/edit.blade.php @@ -0,0 +1,49 @@ +@extends('projects.layout') + +@section('content') +
+
+
+

Edit Project

+
+
+ Back +
+
+
+ + @if ($errors->any()) +
+ Whoops! There were some problems with your input.

+ +
+ @endif + +
+ @csrf + @method('PUT') + +
+
+
+ Name: + +
+
+
+
+ Detail: + +
+
+
+ +
+
+ +
+@endsection diff --git a/resources/views/projects/index.blade.php b/resources/views/projects/index.blade.php new file mode 100644 index 0000000..0a64093 --- /dev/null +++ b/resources/views/projects/index.blade.php @@ -0,0 +1,93 @@ + + + + + + Projects + + + + + + + +
+
+
+
+

Projects

+ Create New Project +
+
+
+ + @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif + +
+ + + + + + + + + + + @foreach ($projects as $project) + + + + + + + @endforeach + +
IDNameDetailsAction
{{ $project->id }}{{ $project->name }}{{ $project->detail }} +
+ Show + Edit +
+ @csrf + @method('DELETE') + +
+
+
+
+ +
+ {{ $projects->links() }} +
+
+ + + diff --git a/resources/views/projects/layout.blade.php b/resources/views/projects/layout.blade.php new file mode 100644 index 0000000..c0dbfb6 --- /dev/null +++ b/resources/views/projects/layout.blade.php @@ -0,0 +1,15 @@ + + + + Project Management + + + + +
+
+ @yield('content') +
+ + + diff --git a/resources/views/projects/show.blade.php b/resources/views/projects/show.blade.php new file mode 100644 index 0000000..f6a384a --- /dev/null +++ b/resources/views/projects/show.blade.php @@ -0,0 +1,29 @@ +@extends('projects.layout') + +@section('content') +
+
+
+

Show Project

+
+
+ Back +
+
+
+ +
+
+
+ Name: + {{ $project->name }} +
+
+
+
+ Details: + {{ $project->detail }} +
+
+
+@endsection diff --git a/resources/views/welcome1.blade.php b/resources/views/welcome1.blade.php new file mode 100644 index 0000000..e305e33 --- /dev/null +++ b/resources/views/welcome1.blade.php @@ -0,0 +1,132 @@ + + + + + + + Laravel + + + + + + + + + + +
+ @if (Route::has('login')) + + @endif + +
+
+ + + + + +
+ +
+
+
+ + +
+
+ Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end. +
+
+
+ +
+
+ + +
+ +
+
+ Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process. +
+
+
+ +
+
+ + +
+ +
+
+ Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials. +
+
+
+ +
+
+ +
Vibrant Ecosystem
+
+ +
+
+ Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more. +
+
+
+
+
+ +
+
+
+ + + + + + Shop + + + + + + + + Sponsor + +
+
+ +
+ Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) +
+
+
+
+ + diff --git a/routes/web.php b/routes/web.php index 0b37cfd..344eb31 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,6 +4,8 @@ use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\UserController; +use App\Http\Controllers\ProductController; + /* |-------------------------------------------------------------------------- @@ -27,7 +29,7 @@ Route::get('/admin/usermanagement',[UserController::class,'index'])->middleware('admin'); -Route::get('/admin/projects', function () { +Route::get('/admin/project', function () { return view('projectlists'); })->middleware('admin'); @@ -41,7 +43,11 @@ return view('contact'); }); + + Route::view('admin/associate-form','associate-form')->middleware('admin'); Route::post('/admin/save-associate','App\Http\Controllers\AssociateController@save')->middleware('admin'); Route::get('/admin/associates-list','App\Http\Controllers\AssociateController@index')->middleware('admin'); +Route::get('/admin/projects', [ProjectController::class, 'index']); +Route::resource('projects', ProjectController::class); From 1033b23841101638d3c156b54c2d607554da6605 Mon Sep 17 00:00:00 2001 From: Shubham Kishan Date: Wed, 13 Mar 2024 13:22:08 +0530 Subject: [PATCH 2/2] Changes --- .env.example | 49 ------- app/Http/Controllers/ProjectController.php | 107 ++++++++++++++ app/Models/Project.php | 17 +++ app/Models/ProjectController.php | 107 ++++++++++++++ database/factories/ProductFactory.php | 29 ++++ ...020_12_31_080627_create_projects_table.php | 33 +++++ ...084959_associate_companies_individuals.php | 9 +- ...1_05_26_124648_create_associates_table.php | 12 +- database/seeders/ProjectTableSeeder.php | 76 ++++++++++ .../update-profile-information-form.blade.php | 44 +----- resources/views/projects/create.blade.php | 70 ++++++++++ resources/views/projects/edit.blade.php | 89 ++++++++++++ resources/views/projects/index.blade.php | 114 +++++++++++++++ resources/views/projects/layout.blade.php | 15 ++ resources/views/projects/show.blade.php | 72 ++++++++++ resources/views/welcome1.blade.php | 132 ++++++++++++++++++ routes/web.php | 8 +- 17 files changed, 881 insertions(+), 102 deletions(-) delete mode 100644 .env.example create mode 100644 app/Http/Controllers/ProjectController.php create mode 100644 app/Models/Project.php create mode 100644 app/Models/ProjectController.php create mode 100644 database/factories/ProductFactory.php create mode 100644 database/migrations/2020_12_31_080627_create_projects_table.php create mode 100644 database/seeders/ProjectTableSeeder.php create mode 100644 resources/views/projects/create.blade.php create mode 100644 resources/views/projects/edit.blade.php create mode 100644 resources/views/projects/index.blade.php create mode 100644 resources/views/projects/layout.blade.php create mode 100644 resources/views/projects/show.blade.php create mode 100644 resources/views/welcome1.blade.php diff --git a/.env.example b/.env.example deleted file mode 100644 index bd67861..0000000 --- a/.env.example +++ /dev/null @@ -1,49 +0,0 @@ -APP_NAME=Laravel -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://localhost - -LOG_CHANNEL=stack -LOG_LEVEL=debug - -DB_CONNECTION=mysql -DB_HOST=127.0.0.1 -DB_PORT=3306 -DB_DATABASE=laravel -DB_USERNAME=root -DB_PASSWORD= - -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=database -SESSION_LIFETIME=120 - -MEMCACHED_HOST=127.0.0.1 - -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 - -MAIL_MAILER=smtp -MAIL_HOST=mailhog -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS=null -MAIL_FROM_NAME="${APP_NAME}" - -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= - -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 - -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php new file mode 100644 index 0000000..6a90a7c --- /dev/null +++ b/app/Http/Controllers/ProjectController.php @@ -0,0 +1,107 @@ +paginate(5); + + return view('projects.index',compact('projects')) + ->with(request()->input('page')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('projects.create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + project::create($request->all()); + + return redirect()->route('projects.index') + ->with('success','Project created successfully.'); + } + + /** + * Display the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function show(project $project) + { + return view('projects.show',compact('project')); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function edit(project $project) + { + return view('projects.edit',compact('project')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function update(Request $request, project $project) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + $project->update($request->all()); + + return redirect()->route('projects.index') + ->with('success','Project updated successfully'); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function destroy(project $project) + { + $project->delete(); + + return redirect()->route('projects.index') + ->with('success','Project deleted successfully'); + } +} diff --git a/app/Models/Project.php b/app/Models/Project.php new file mode 100644 index 0000000..2d6f8ea --- /dev/null +++ b/app/Models/Project.php @@ -0,0 +1,17 @@ +paginate(5); + + return view('projects.index',compact('projects')) + ->with(request()->input('page')); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('projects.create'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + project::create($request->all()); + + return redirect()->route('projects.index') + ->with('success','project created successfully.'); + } + + /** + * Display the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function show(project $project) + { + return view('projects.show',compact('project')); + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function edit(project $project) + { + return view('projects.edit',compact('project')); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function update(Request $request, project $project) + { + $request->validate([ + 'name' => 'required', + 'detail' => 'required', + ]); + + $project->update($request->all()); + + return redirect()->route('projects.index') + ->with('success','project updated successfully'); + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\project $project + * @return \Illuminate\Http\Response + */ + public function destroy(project $project) + { + $project->delete(); + + return redirect()->route('projects.index') + ->with('success','project deleted successfully'); + } +} diff --git a/database/factories/ProductFactory.php b/database/factories/ProductFactory.php new file mode 100644 index 0000000..12b186a --- /dev/null +++ b/database/factories/ProductFactory.php @@ -0,0 +1,29 @@ + $this->faker->name, + 'detail' => $this->faker->text(200) + ]; + } +} diff --git a/database/migrations/2020_12_31_080627_create_projects_table.php b/database/migrations/2020_12_31_080627_create_projects_table.php new file mode 100644 index 0000000..e54d4a8 --- /dev/null +++ b/database/migrations/2020_12_31_080627_create_projects_table.php @@ -0,0 +1,33 @@ +id(); + $table->string('name'); + $table->string('detail'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('projects'); + } +} diff --git a/database/migrations/2021_05_11_084959_associate_companies_individuals.php b/database/migrations/2021_05_11_084959_associate_companies_individuals.php index 606f2b1..040b971 100644 --- a/database/migrations/2021_05_11_084959_associate_companies_individuals.php +++ b/database/migrations/2021_05_11_084959_associate_companies_individuals.php @@ -14,18 +14,20 @@ class AssociateCompaniesIndividuals extends Migration public function up() { Schema::create('associate_companies_individuals', function (Blueprint $table) { - //$table->id(); $table->bigIncrements('id'); $table->unsignedBigInteger('user_id'); $table->foreign('user_id')->references('id')->on('users'); $table->string('name', 100); $table->enum('type', ['company', 'individual']); $table->string('phone'); - //$table->binary('logo'); $table->text('description'); $table->timestamps(); }); - DB::statement("ALTER TABLE associate_companies_individuals ADD logo MEDIUMBLOB"); + + // Adding the logo column as BLOB after table creation + Schema::table('associate_companies_individuals', function (Blueprint $table) { + $table->binary('logo')->after('description')->nullable(); + }); } /** @@ -35,6 +37,7 @@ public function up() */ public function down() { + // Dropping the table if it exists Schema::dropIfExists('associate_companies_individuals'); } } diff --git a/database/migrations/2021_05_26_124648_create_associates_table.php b/database/migrations/2021_05_26_124648_create_associates_table.php index a4df820..670910b 100644 --- a/database/migrations/2021_05_26_124648_create_associates_table.php +++ b/database/migrations/2021_05_26_124648_create_associates_table.php @@ -15,12 +15,12 @@ public function up() { Schema::create('associates', function (Blueprint $table) { $table->id(); - $table->string('name'); - $table->string('type'); - $table->string('address'); - $table->string('email'); - $table->('phone1'); - $table->('phone2'); + $table->string('name'); + $table->string('type'); + $table->string('address'); + $table->string('email'); + $table->string('phone1'); // Added 'string' to specify data type + $table->string('phone2'); // Added 'string' to specify data type $table->timestamps(); }); } diff --git a/database/seeders/ProjectTableSeeder.php b/database/seeders/ProjectTableSeeder.php new file mode 100644 index 0000000..037efc0 --- /dev/null +++ b/database/seeders/ProjectTableSeeder.php @@ -0,0 +1,76 @@ + 'Product #1', + 'detail' => 'Product #1 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #2', + 'detail' => 'Product #2 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #3', + 'detail' => 'Product #3 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #4', + 'detail' => 'Product #4 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #5', + 'detail' => 'Product #5 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #6', + 'detail' => 'Product #6 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #7', + 'detail' => 'Product #7 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #8', + 'detail' => 'Product #8 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #9', + 'detail' => 'Product #9 details' + ]); + $product->save(); + + $product = new \App\Models\Product([ + 'name' => 'Product #10', + 'detail' => 'Product #10 details' + ]); + $product->save(); + } +} diff --git a/resources/views/profile/update-profile-information-form.blade.php b/resources/views/profile/update-profile-information-form.blade.php index d01f102..d7f8cf0 100644 --- a/resources/views/profile/update-profile-information-form.blade.php +++ b/resources/views/profile/update-profile-information-form.blade.php @@ -8,49 +8,7 @@ - - @if (Laravel\Jetstream\Jetstream::managesProfilePhotos()) -
- - - - - - -
- {{ $this->user->name }} -
- - -
- - -
- - - {{ __('Select A New Photo') }} - - - @if ($this->user->profile_photo_path) - - {{ __('Remove Photo') }} - - @endif - - -
- @endif +
diff --git a/resources/views/projects/create.blade.php b/resources/views/projects/create.blade.php new file mode 100644 index 0000000..b91f524 --- /dev/null +++ b/resources/views/projects/create.blade.php @@ -0,0 +1,70 @@ + + +
+ + Back + +

Project Management

+
+
+ +
+
+
+
+ +
+
+

Add New Project

+
+
+ + +
+
+ @if ($errors->any()) +
+ Whoops! There were some problems with your input.

+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +
+ @csrf + + +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ + +
+ +
+
+ +
+
+
+
+
+
+
+
diff --git a/resources/views/projects/edit.blade.php b/resources/views/projects/edit.blade.php new file mode 100644 index 0000000..38811df --- /dev/null +++ b/resources/views/projects/edit.blade.php @@ -0,0 +1,89 @@ +@push('head') + + + + + +@endpush + + + +
+ + Back + +

Project Management

+
+
+ +
+
+
+
+ +
+
+

Edit Project

+
+
+ + +
+
+ @if ($errors->any()) +
+ Whoops! There were some problems with your input.

+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +
+ @csrf + @method('PUT') + + +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ + +
+ +
+
+ +
+
+
+
+
+
+
+
diff --git a/resources/views/projects/index.blade.php b/resources/views/projects/index.blade.php new file mode 100644 index 0000000..1a855a7 --- /dev/null +++ b/resources/views/projects/index.blade.php @@ -0,0 +1,114 @@ + + +
+

+ {{ __('Project Management') }} +

+ +
+
+ + + + + + Projects + + + + + + + + +
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif +
+ + + + + + + + + + @foreach ($projects as $project) + + + + + + @endforeach + +
NAMEDETAILSACTION
{{ $project->name }}{{ $project->detail }} +
+ + +
+ @csrf + @method('DELETE') + +
+
+
+
+
+ {{ $projects->links() }} +
+
+ + + + + + + + + + +
diff --git a/resources/views/projects/layout.blade.php b/resources/views/projects/layout.blade.php new file mode 100644 index 0000000..c0dbfb6 --- /dev/null +++ b/resources/views/projects/layout.blade.php @@ -0,0 +1,15 @@ + + + + Project Management + + + + +
+
+ @yield('content') +
+ + + diff --git a/resources/views/projects/show.blade.php b/resources/views/projects/show.blade.php new file mode 100644 index 0000000..988cd2f --- /dev/null +++ b/resources/views/projects/show.blade.php @@ -0,0 +1,72 @@ +@push('head') + + + + + +@endpush + + + +
+ + Back + +

+ Show Project +

+
+
+ +
+
+
+
+ +
+
+

Show Project

+
+
+ + +
+
+
+
+

+
+
+
+ + + + + + + + + + + +
Name:{{ $project->name }}
Details:{{ $project->detail }}
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/welcome1.blade.php b/resources/views/welcome1.blade.php new file mode 100644 index 0000000..e305e33 --- /dev/null +++ b/resources/views/welcome1.blade.php @@ -0,0 +1,132 @@ + + + + + + + Laravel + + + + + + + + + + +
+ @if (Route::has('login')) + + @endif + +
+
+ + + + + +
+ +
+
+
+ + +
+
+ Laravel has wonderful, thorough documentation covering every aspect of the framework. Whether you are new to the framework or have previous experience with Laravel, we recommend reading all of the documentation from beginning to end. +
+
+
+ +
+
+ + +
+ +
+
+ Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process. +
+
+
+ +
+
+ + +
+ +
+
+ Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials. +
+
+
+ +
+
+ +
Vibrant Ecosystem
+
+ +
+
+ Laravel's robust library of first-party tools and libraries, such as Forge, Vapor, Nova, and Envoyer help you take your projects to the next level. Pair them with powerful open source libraries like Cashier, Dusk, Echo, Horizon, Sanctum, Telescope, and more. +
+
+
+
+
+ +
+
+
+ + + + + + Shop + + + + + + + + Sponsor + +
+
+ +
+ Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}) +
+
+
+
+ + diff --git a/routes/web.php b/routes/web.php index 0b37cfd..344eb31 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,6 +4,8 @@ use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\UserController; +use App\Http\Controllers\ProductController; + /* |-------------------------------------------------------------------------- @@ -27,7 +29,7 @@ Route::get('/admin/usermanagement',[UserController::class,'index'])->middleware('admin'); -Route::get('/admin/projects', function () { +Route::get('/admin/project', function () { return view('projectlists'); })->middleware('admin'); @@ -41,7 +43,11 @@ return view('contact'); }); + + Route::view('admin/associate-form','associate-form')->middleware('admin'); Route::post('/admin/save-associate','App\Http\Controllers\AssociateController@save')->middleware('admin'); Route::get('/admin/associates-list','App\Http\Controllers\AssociateController@index')->middleware('admin'); +Route::get('/admin/projects', [ProjectController::class, 'index']); +Route::resource('projects', ProjectController::class);