Use a less generic model name than Client
This commit is contained in:
parent
4bb454c545
commit
12c91eab70
3 changed files with 7 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Client;
|
use App\MicropubClient;
|
||||||
|
|
||||||
class ClientsAdminController extends Controller
|
class ClientsAdminController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ class ClientsAdminController extends Controller
|
||||||
*/
|
*/
|
||||||
public function listClients()
|
public function listClients()
|
||||||
{
|
{
|
||||||
$clients = Client::all();
|
$clients = MicropubClient::all();
|
||||||
|
|
||||||
return view('admin.listclients', ['clients' => $clients]);
|
return view('admin.listclients', ['clients' => $clients]);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class ClientsAdminController extends Controller
|
||||||
*/
|
*/
|
||||||
public function postNewClient(Request $request)
|
public function postNewClient(Request $request)
|
||||||
{
|
{
|
||||||
Client::create([
|
MicropubClient::create([
|
||||||
'client_url' => $request->input('client_url'),
|
'client_url' => $request->input('client_url'),
|
||||||
'client_name' => $request->input('client_name'),
|
'client_name' => $request->input('client_name'),
|
||||||
]);
|
]);
|
||||||
|
@ -52,7 +52,7 @@ class ClientsAdminController extends Controller
|
||||||
*/
|
*/
|
||||||
public function editClient($clientId)
|
public function editClient($clientId)
|
||||||
{
|
{
|
||||||
$client = Client::findOrFail($clientId);
|
$client = MicropubClient::findOrFail($clientId);
|
||||||
|
|
||||||
return view('admin.editclient', [
|
return view('admin.editclient', [
|
||||||
'id' => $clientId,
|
'id' => $clientId,
|
||||||
|
@ -70,7 +70,7 @@ class ClientsAdminController extends Controller
|
||||||
*/
|
*/
|
||||||
public function postEditClient($clientId, Request $request)
|
public function postEditClient($clientId, Request $request)
|
||||||
{
|
{
|
||||||
$client = Client::findOrFail($clientId);
|
$client = MicropubClient::findOrFail($clientId);
|
||||||
if ($request->input('edit')) {
|
if ($request->input('edit')) {
|
||||||
$client->client_url = $request->input('client_url');
|
$client->client_url = $request->input('client_url');
|
||||||
$client->client_name = $request->input('client_name');
|
$client->client_name = $request->input('client_name');
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Client extends Model
|
class MicropubClient extends Model
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
|
@ -150,7 +150,7 @@ class Note extends Model implements HasMedia
|
||||||
if ($this->client_id == null) {
|
if ($this->client_id == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$name = Client::where('client_url', $this->client_id)->value('client_name');
|
$name = MicropubClient::where('client_url', $this->client_id)->value('client_name');
|
||||||
if ($name == null) {
|
if ($name == null) {
|
||||||
$url = parse_url($this->client_id);
|
$url = parse_url($this->client_id);
|
||||||
if (isset($url['path'])) {
|
if (isset($url['path'])) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue