/**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     if (Gate::denies('addClient', new Client())) {
         abort(403, 'You are now allowed here');
     }
     $client = Client::lists('name', 'id');
     return view('project.create')->with('client', $client);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $facture = Facture::findOrFail($id);
     /*Lists*/
     $projects = Project::lists('name', 'id');
     $selectedProjects = $facture->projects->lists('id')->flatten()->all();
     $contacts = Contact::select('id', DB::raw('CONCAT(first_name, " ", last_name) as full_name'))->orderBy('last_name', 'asc')->lists('full_name', 'id');
     $clients = Client::lists('email', 'id');
     //dd($selectedProjects);
     return view('admin.facture.edit', compact('facture', 'projects', 'selectedProjects', 'contacts', 'clients'));
 }
Example #3
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $reportOptions = [];
     $reportOptions['sales'] = 'Sales';
     $reportOptions['collection'] = 'Collection';
     $reportOptions['item'] = 'Item';
     $reportOptions['client'] = 'Client';
     $clients = Client::lists('name', 'id');
     $items = Item::lists('name', 'id');
     //$yearOptions = [];
     //$counter = 0;
     //$years = DB::select("SELECT YEAR(date) AS 'year' FROM sales_invoices")->get();
     $years = DB::table('sales_invoices')->select(db::raw('YEAR(date) as yearDate'))->lists('yearDate', 'yearDate');
     //$years = Salesinvoice::lists('date');
     return view('reports.index', compact('reportOptions', 'clients', 'items', 'years'));
     //return $years;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $clients = Client::lists('name', 'id');
     return view('testView', compact('clients'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  Project  $project
  * @return Response
  */
 public function edit(Project $project)
 {
     $clients = Client::lists('name', 'id');
     return view('projects.edit', compact('clients', 'project'));
 }
Example #6
0
 public function edit(Client $client)
 {
     $clients = Client::lists('first_name', 'id');
     return view('clients.edit', compact('client', 'clients'));
 }