mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:57:32 -05:00 
			
		
		
		
	View Composer for Client Portal
This commit is contained in:
		
							parent
							
								
									990bba510b
								
							
						
					
					
						commit
						2df2ec44ba
					
				@ -70,7 +70,7 @@ class ContactResetPasswordController extends Controller
 | 
			
		||||
        return Auth::guard('contact');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function broker()
 | 
			
		||||
    public function broker()
 | 
			
		||||
    {
 | 
			
		||||
      return Password::broker('contacts'); 
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@ class DashboardController extends Controller
 | 
			
		||||
     */
 | 
			
		||||
    public function index()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        return view('portal.default.dashboard.index');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										48
									
								
								app/Http/ViewComposers/PortalComposer.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								app/Http/ViewComposers/PortalComposer.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
<?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\ViewComposers;
 | 
			
		||||
 | 
			
		||||
use Illuminate\View\View;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class PortalComposer
 | 
			
		||||
 * @package App\Http\ViewComposers
 | 
			
		||||
 */
 | 
			
		||||
class PortalComposer
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Bind data to the view.
 | 
			
		||||
     *
 | 
			
		||||
     * @param  View  $view
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function compose(View $view)
 | 
			
		||||
    {
 | 
			
		||||
        $view->with('header', $this->portalData());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @return array
 | 
			
		||||
     */
 | 
			
		||||
    private function portalData()
 | 
			
		||||
    {
 | 
			
		||||
        if(!auth()->user())
 | 
			
		||||
            return [];
 | 
			
		||||
 | 
			
		||||
        $data = [];
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        return $data;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -22,15 +22,17 @@ class ComposerServiceProvider extends ServiceProvider
 | 
			
		||||
     */
 | 
			
		||||
    public function boot()
 | 
			
		||||
    {
 | 
			
		||||
        view()->composer('portal.*', 'App\Http\ViewComposers\PortalComposer');
 | 
			
		||||
        
 | 
			
		||||
        view()->composer('*', 'App\Http\ViewComposers\HeaderComposer');
 | 
			
		||||
 | 
			
		||||
        //view()->composer('*', 'App\Http\ViewComposers\HeaderComposer');
 | 
			
		||||
/*
 | 
			
		||||
        view()->composer(
 | 
			
		||||
            [
 | 
			
		||||
                'client.edit',
 | 
			
		||||
            ],
 | 
			
		||||
            'App\Http\ViewComposers\TranslationComposer'
 | 
			
		||||
        );
 | 
			
		||||
  */
 | 
			
		||||
       
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								resources/views/portal/default/dashboard/index.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								resources/views/portal/default/dashboard/index.blade.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,5 @@
 | 
			
		||||
@extends('portal.default.layouts.master')
 | 
			
		||||
 | 
			
		||||
@section('body')
 | 
			
		||||
 | 
			
		||||
@endsection
 | 
			
		||||
@ -9,7 +9,7 @@
 | 
			
		||||
<script src="/vendors/js/popper.min.js"></script>
 | 
			
		||||
<script src="/vendors/js/bootstrap.min.js"></script>
 | 
			
		||||
<script src="/vendors/js/perfect-scrollbar.min.js"></script>
 | 
			
		||||
<script src="/vendors/coreui.min.js"></script>
 | 
			
		||||
<script src="/vendors/js/coreui.min.js"></script>
 | 
			
		||||
<script>
 | 
			
		||||
$('#ui-view').ajaxLoad();
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@ -34,8 +34,8 @@
 | 
			
		||||
  <meta charset="utf-8">
 | 
			
		||||
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
			
		||||
  <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
 | 
			
		||||
  <meta name="author" content="Łukasz Holeczek">
 | 
			
		||||
  <meta name="keyword" content="Bootstrap,Admin,Template,Open,Source,jQuery,CSS,HTML,RWD,Dashboard">
 | 
			
		||||
  <meta name="author" content="Hillel Coren, David Bomba">
 | 
			
		||||
  <meta name="keyword" content="">
 | 
			
		||||
  <!-- Icons-->
 | 
			
		||||
  <link href="/vendors/css/coreui-icons.min.css" rel="stylesheet">
 | 
			
		||||
  <link href="/vendors/css/font-awesome.min.css" rel="stylesheet">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user