Working on client portal profile

This commit is contained in:
David Bomba 2019-08-02 10:31:48 +10:00
parent 9d76b234a8
commit 9b1075539c
5 changed files with 76 additions and 1 deletions

View File

@ -0,0 +1,55 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Controllers\ClientPortal;
use App\Http\Controllers\Controller;
use App\Models\ClientContact;
use Illuminate\Http\Request;
class ProfileController extends Controller
{
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit(ClientContact $client_contact)
{
dd($client_contact);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, ClientContact $client_contact)
{
dd($client_contact);
}
}

View File

@ -42,6 +42,15 @@ class ClientContact extends Authenticatable
/* Allow microtime timestamps */
protected $dateFormat = 'Y-m-d H:i:s.u';
protected $appends = [
'hashed_id'
];
public function getHashedIdAttribute()
{
return $this->encodePrimaryKey($this->id);
}
protected $hidden = [
'password',
'remember_token',

View File

@ -49,6 +49,15 @@ class User extends Authenticatable implements MustVerifyEmail
public $company;
protected $appends = [
'hashed_id'
];
public function getHashedIdAttribute()
{
return $this->encodePrimaryKey($this->id);
}
/**
* The attributes that are mass assignable.
*

View File

@ -45,7 +45,7 @@
<div class="dropdown-header text-center">
<strong>@lang('texts.settings')</strong>
</div>
<a class="dropdown-item" href="#">
<a class="dropdown-item" href="{{ route('client.profile.edit', ['id' => auth()->user()->hashed_id])}}">
<i class="fa fa-user"></i> @lang('texts.profile')</a>
<a class="dropdown-item" href="">
<i class="fa fa-wrench"></i> @lang('texts.settings')</a>

View File

@ -14,6 +14,8 @@ Route::group(['middleware' => ['auth:contact'], 'prefix' => 'client', 'as' => 'c
Route::get('dashboard', 'ClientPortal\DashboardController@index')->name('dashboard'); // name = (dashboard. index / create / show / update / destroy / edit
Route::get('invoices', 'ClientPortal\InvoiceController@index')->name('invoices.index'); // name = (dashboard. index / create / show / update / destroy / edit
Route::get('profile/{client_contact}/edit', 'ClientPortal\ProfileController@edit')->name('profile.edit');
Route::put('profile/{client_contact}/edit', 'ClientPortal\ProfileController@update')->name('profile.update');
Route::get('logout', 'Auth\ContactLoginController@logout')->name('logout');