Working with blade I have a layout and I have created a package that has several view blade components, this components are then render on the apps blade as follows.
layout > apps
<head>
@stack('css')
@yield('styles')
</head>
<body>
<main class="py-4">
@yield('content')
{{--Render package components--}}
@includeIf('package::view-blade')
</main>
@yield('scripts')
</body>
I am able to render scripts from the components as follows:
package > resources > components > view-blade
@section('scripts')
@parent
<script src="{{asset('path-to-scripts')}}"></script>
@endsection
But when I try the same for styles it does not work, i.e
@section('styles')
@parent
<link type="text/css" href="{{asset('path-to-styles')}}"/>
@endsection
Or
@push('css')
<link type="text/css" href="{{asset('path-to-styles')}}"/>
@endpush
How can i render styles to the app.blade file dynamically from the package component file? to clarify I am not extending the app layout on the component