Miscellaneous code snippets + documentation extension #1619
Replies: 4 comments 6 replies
-
As a first code example. I have a LayoutList and within the LayouList I have the TD-objects in an array. Is there a way I can have 1 column with multiple buttons? Answer: The TD::make('options', trans('admin.options') )
->width(240)
->render( function(Project $project) {
return
Group::make([
Link::make(__('admin.crud.show'))
->icon('magnifier')
->route('platform.projects.show', $project->id),
Link::make(__('admin.crud.edit'))
->icon('pencil')
->route('platform.projects.edit', $project->id)
])->render();
}), |
Beta Was this translation helpful? Give feedback.
-
I am not sure if I really like this solution yet, but the intention was a mimic of the Laravel Usage: <?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Route;
class ScreenResourceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
Route::macro('screenresource', function( $url, $className ) {
Route::screen( $url . '/create' , "{$className}EditScreen")->name('platform.'.$url.'.create');
Route::screen( $url . '/index' , "{$className}ListScreen")->name('platform.'.$url.'.index');
Route::screen( $url . '/{project}/show' , "{$className}ShowScreen")->name('platform.'.$url.'.show');
Route::screen( $url . '/{project}/edit' , "{$className}EditScreen")->name('platform.'.$url.'.edit');
});
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
//
}
} |
Beta Was this translation helpful? Give feedback.
-
Hi guys. I added a recipes section to the site where you can publish your solution. (To date, very early stage) |
Beta Was this translation helpful? Give feedback.
-
Hi all, I have released my example package to demonstrate what I suggested earlier. |
Beta Was this translation helpful? Give feedback.
-
A place to gather miscellaneous code snippets which can help new users start out, or a place to learn some neat tricks.
These suggestions are merely to get up to speed. Some people learn by reading code, some people learn by seeing examples, etc.
Perhaps the best suggestions/examples can eventually be merged in to the documentation.
Also a random list of stuff what is "missing" (as missing is rather subjective):
Beta Was this translation helpful? Give feedback.
All reactions