Files
isop-mirror/backend/app/Http/Controllers/CompanyController.php

77 lines
1.4 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Company;
use App\Models\User;
use Illuminate\Http\Request;
class CompanyController extends Controller
{
public function all_simple() {
$companies = Company::all()->makeHidden(['created_at', 'updated_at']);
$companies->each(function ($company) {
$company->contact = User::find($company->contact)->makeHidden(['created_at', 'updated_at', 'email_verified_at']);
});
return response()->json($companies);
}
/**
* Display a listing of the resource.
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Company $company)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Company $company)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, Company $company)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Company $company)
{
//
}
}