laravel-5.4
Pluck with Where condition
I found the mistake. I should use pluck with where condition like below. $specialities = Speciality::where(‘role_id’,$request->roleid)->pluck(‘name’,’id’); Pluck won’t filter anything, but it gives only what needed. So filtering has to be done before that.
Match JsonStructure in PhpUnit Test – Laravel 5.4
Luckily, playing with different options I have solved this issue. A ‘*’ is expected as key if we are to match a nested object in an array. We can see the reference here. Source: TestResponse I have set the structure like this for array ofobjects` $response->assertJsonStructure([ ‘status’, ‘message’, ‘data’ => [ ‘*’ => [ ‘id’, … Read more
Including a css file in a blade template?
@include directive allows you to include a Blade view from within another view, like this : @include(‘another.view’) Include CSS or JS from master layout asset() The asset function generates a URL for an asset using the current scheme of the request (HTTP or HTTPS): <link href=”{{ asset(‘css/styles.css’) }}” rel=”stylesheet”> <script type=”text/javascript” src=”{{ asset(‘js/scripts.js’) }}”></script> mix() … Read more