Page Last updated: 2022-09-30
You may need to customize pages with some of the elements
So you can create pages and customize these pages according to your needs
For example, controlling admin data for himself or making a page for settings
You can make a page through the command
php artisan dash:make-page AdminAccount
AdminAccount page generated
This object will be created in the path app/Dash/Pages
namespace App\Dash\Pages;
use App\Models\Admin;
use Dash\Pages;
class AdminAccount extends Pages {
public static $model = Admin::class ;
public static $icon = '<i class="fa fa-user"></i>';
public static $position = 'bottom';// top|bottom
public static $successMessage = 'account updated successfully';
/**
* custom page name
* @return string
*/
public static function pageName() {
return 'Account Setting';
}
/**
* custom content page
* @return you can ini view method to render blade file
*/
public static function content() {
return view('AdminAccount', [
'title' => static ::pageName(),
]);
}
}
And another file will be created in the path resources/views
AdminAccount.blade.php
@extends('dash::app')
@section('content')
<div class="container-fluid py-4">
<div class="row">
<div class="col-12">
<div class="card my-4">
<div class="card-header">
<div class="row">
<div class="col-6">
<h6 class="text-dark text-capitalize">{{ $title }} </h6>
</div>
</div>
</div>
<div class="card-body px-3 pb-2">
<div class="row">
<form action="{{ url()->current() }}/{{ admin()->id }}" method="post">
@csrf
<div class="col-12">
<label for="inputname" class="form-label">Name</label>
<input type="text" class="form-control {{ $errors->has('name')?'is-invalid':'' }} border" id="inputname" aria-describedby="inputname" value="{{ admin()->name }}" placeholder="Name" name="name" >
<div id="inputname" class="form-text">من فضلك اكتب الاسم</div>
@error('name')
<p class="invalid-feedback">{{ $message }}</p>
@enderror
</div>
<button type="submit" class="btn btn-success">تحديث</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
These contents can be customized and modified
This object can be added to App\Providers\DashServiceProvider
in blankPages()
method
public static function blankPages() {
return [
\App\Dash\Pages\AdminAccount::class,
];
}
You can also through the property
public static $position = 'bottom';// top|bottom
Displays the page in the list at the top of the list or at the bottom, according to the order of the objects