File tree Expand file tree Collapse file tree 6 files changed +16
-10
lines changed
Expand file tree Collapse file tree 6 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3- ** All notable changes to ` AdminR ` will be documented in this file **
3+ ==================================================
44
5+ ## Release v0.3.0 - Jun 21, 2022
56
6- ==================================================
7+ - Added ``` foreignId ``` data type.
78
9+ ==================================================
810## Release v0.2.5 - May 02, 2022
911
1012- Added Default mail templates.
Original file line number Diff line number Diff line change 1- # AdminR v0.2.5
1+ # AdminR v0.3.0
22
33<p align =" center " >
4- <a href =" https://travis-ci.org/thedevsbuddy/adminr " ><img src =" https://travis-ci.org/thedevsbuddy/adminr.svg " alt =" Build Status " ></a >
54<a href =" https://packagist.org/packages/thedevsbuddy/adminr " ><img src =" https://img.shields.io/packagist/dt/thedevsbuddy/adminr " alt =" Total Downloads " ></a >
65<a href =" https://packagist.org/packages/thedevsbuddy/adminr " ><img src =" https://img.shields.io/packagist/v/thedevsbuddy/adminr " alt =" Latest Stable Version " ></a >
76<a href =" https://packagist.org/packages/thedevsbuddy/adminr " ><img src =" https://img.shields.io/packagist/l/thedevsbuddy/adminr " alt =" License " ></a >
Original file line number Diff line number Diff line change 11 <div class="{{COL_SM}} {{COL_MD}} {{COL_LG}}">
22 <div class="form-group has-feedback @if($errors->has('{{FIELD_NAME}}')) has-error @endif">
33 <label for="{{FIELD_NAME}}">{{FIELD_NAME_LABEL}}</label>
4- <select name="{{FIELD_NAME}}" id="{{FIELD_NAME}}" class="form-control @if($errors->has('{{FIELD_NAME}}')) is-invalid @endif" placeholder="{{FIELD_NAME_LABEL}}" {{REQUIRED_STATEMENT}}>
4+ <select name="{{FIELD_NAME}}" id="{{FIELD_NAME}}" class="form-control @if($errors->has('{{FIELD_NAME}}')) is-invalid @endif" {{REQUIRED_STATEMENT}}>
55 {{OPTIONS_STATEMENT}}
66 </select>
77 @if ($errors->has('{{FIELD_NAME}}'))
1010 </span>
1111 @endif
1212 </div>
13- </div>
13+ </div>
Original file line number Diff line number Diff line change 11 <div class="{{COL_SM}} {{COL_MD}} {{COL_LG}}">
22 <div class="form-group has-feedback @if($errors->has('{{FIELD_NAME}}')) has-error @endif">
33 <label for="{{FIELD_NAME}}">{{FIELD_NAME_LABEL}}</label>
4- <select name="{{FIELD_NAME}}" id="{{FIELD_NAME}}" class="form-control @if($errors->has('{{FIELD_NAME}}')) is-invalid @endif" placeholder="{{FIELD_NAME_LABEL}}" {{REQUIRED_STATEMENT}}>
4+ <select name="{{FIELD_NAME}}" id="{{FIELD_NAME}}" class="form-control @if($errors->has('{{FIELD_NAME}}')) is-invalid @endif" {{REQUIRED_STATEMENT}}>
55 {{OPTIONS_STATEMENT}}
66 </select>
77 @if ($errors->has('{{FIELD_NAME}}'))
1010 </span>
1111 @endif
1212 </div>
13- </div>
13+ </div>
Original file line number Diff line number Diff line change @@ -206,14 +206,19 @@ private function getOldFileStatement(): string
206206 return $ oldFileStmt ;
207207 }
208208
209- #[Pure] private function getOptionsStmt ($ migration ): string
209+ private function getOptionsStmt ($ migration ): string
210210 {
211211 $ optionsStmt = "" ;
212212 if ($ migration ['data_type ' ] == 'enum ' ){
213213 $ optionsStmt .= "<option value= \"\">--Select " .Str::title ($ migration ['field_name ' ])."--</option> \n\t\t" ;
214214 foreach (preg_split ('/[,\s?]+/ ' , $ migration ['enum_values ' ]) as $ val ){
215215 $ optionsStmt .= "<option value= \"" .strtolower ($ val )."\"> " .Str::title ($ val )."</option> \n\t\t" ;
216216 }
217+ } else if ($ migration ['data_type ' ] == 'foreignId ' ){
218+ $ optionsStmt .= "<option value= \"\">--Select " .Str::title ($ migration ['related_model ' ])."--</option> \n\t\t\t\t\t\t\t\t\t\t" ;
219+ $ optionsStmt .= "@foreach($ " .Str::camel (Str::plural ($ migration ['related_model ' ]))." as \$index => $ " .Str::camel (Str::singular ($ migration ['related_model ' ])).") \n\t\t\t\t\t\t\t\t\t\t\t" ;
220+ $ optionsStmt .= "<option value= \"{{ \$" .Str::camel (Str::singular ($ migration ['related_model ' ]))."->id}} \">{{ \$" .Str::camel (Str::singular ($ migration ['related_model ' ]))."-> " .Str::snake ($ migration ['related_model_label ' ])."}}</option> \n\t\t\t\t\t\t\t\t\t\t" ;
221+ $ optionsStmt .= "@endforeach " ;
217222 }
218223
219224 return $ optionsStmt ;
Original file line number Diff line number Diff line change 11{
22 "name" : " thedevsbuddy/adminr" ,
3- "version" : " 0.2.5 " ,
3+ "version" : " 0.3.0 " ,
44 "type" : " project" ,
55 "description" : " A simple yet powerful laravel starter with admin panel and CRUD resources generator to help you build application faster." ,
66 "keywords" : [
You can’t perform that action at this time.
0 commit comments