Ejemplo n.º 1
0
    return App\Status::whereSlug($slug)->first();
});
Route::bind('owner', function ($slug) {
    return App\Owner::whereSlug($slug)->first();
});
Route::bind('user', function ($id) {
    return App\User::find($id);
});
Route::bind('note', function ($id) {
    return App\Note::find($id);
});
Route::bind('information', function ($id) {
    return App\Information::find($id);
});
Route::bind('field', function ($id) {
    return App\Field::find($id);
});
Route::bind('activity', function ($id) {
    return App\Activity::find($id);
});
# ROUTE RESOURCE
# CATEGORY RESOURCE
Route::resource('category', 'CategoryController');
Route::get('change_password', ['as' => 'change_password', 'uses' => 'UserController@viewChangePassword']);
// GET
get('{category_slug}/category_history', ['as' => 'c_h', 'uses' => 'CategoryController@categoryHistory']);
get('{category_slug}/associate-dissociate-history', ['as' => 'ch', 'uses' => 'CategoryController@viewCategoryHistory']);
get('{category_slug}/statuses', ['as' => 'sh', 'uses' => 'CategoryController@viewCategoryStatusesHistory']);
get('{category_slug}/statuses_history', ['as' => 'c_s_h', 'uses' => 'CategoryController@categoryStatusHistory']);
get('fetch/devices/{info_id}/{category_id}', ['as' => 'f_d_i', 'uses' => 'CategoryController@fetch_devices_infoValue']);
get('fetch/category/{category_slug}', ['as' => 'f_c_cs', 'uses' => 'CategoryController@fetchCatName']);
Ejemplo n.º 2
0



                                                    </center>
                                                @elseif($relation->pivot->laravel_name == 'belongsToMany')
                                                        <center>
                                                            <p>
                                                                <i class="fa fa-arrow-right"></i>
                                                                <a href="{{route('admin.devis.{devis}.tables.edit_table_relation', [$devis->id, $relation->pivot->from_field_id,$relation->pivot->to_field_id])}}">
                                                                    <b style="color:orangered">{{$relation->pivot->laravel_name}}</b>
                                                                </a>
                                                            </p>
                                                            <p>
                                                                <?php 
$related_table = App\Field::find($relation->pivot->to_field_id)->table()->first();
?>
                                                                {{-- {{dd(AppField::find($relation->pivot->from_field_id)->table_id)}} --}}

                                                                <a href="{{route('admin.devis.{devis}.admin.table.edit', [$devis->id, $related_table->id])}}"
                                                                    ><h4{{$related_table->name }}</h4>
                                                                </a>
                                                                {{-- {{dd($related_table->fields)}} --}}
                                                                <ul>
                                                                    @forelse($related_table->fields as $related_table)
                                                                        <li>{{$related_table->id}} - {{$related_table->name}}</li>
                                                                    @empty
                                                                        No fields yet
                                                                    @endforelse
                                                                </ul>
                                                            </p>