mardi 17 novembre 2020

Cannot display image in vue.js

I'm saving image in following path :

storage\app\public\img\user_image

and saving image url like this in database:

/img/user_image/285070719.png

trying to display image like this:

 <img :src="'../app/public'+profile.image">

but the image does not display, Any solution to resolve this issue is highly appreciated.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32S7xs4
via IFTTT

How to get Expiry date flag from pivot table Joining the parent table grouped by parent_id

I have a parent table with jobs and a pivot table with job provider (boards) and expiry dates.

Adjob table

id:1, job_title: Experienced full stack developer, .. .. location:Europe is_active:1

Boards table

id:1, adjob_id:1, board_name:Adzuna, expiry_date:2020-12-20,

id:2 adjob_id:1, board_name:Seek, expiry_date:2020-11-10,

id:3, adjob_id:1, board_name:Jora, expiry_date:2020-11-25,

This is the query used

$ads= Adjob::select([
            'adjobs.id',
            'adjobs.response',
            'adjobs.post_date',
            'adjobs.job_title',
            'adjobs.created_by',
            \DB::raw('(CASE 
                    WHEN (boards.board_name = "Adzuna" && (NOW() < boards.expiry_date && datediff(expiry_date,NOW()) <= 7)) THEN "1" 
                    WHEN (boards.board_name = "Jora" && (NOW() < boards.expiry_date && datediff(expiry_date,NOW()) <= 7)) THEN "1" 
                    WHEN (boards.board_name = "Seek" && (NOW() < boards.expiry_date && datediff(expiry_date,NOW()) <= 7)) THEN "1" 
                    ELSE "0" 
                    END) AS expiry')
            ])
            ->leftJoin('boards', 'adjobs.id', 'boards.adjob_id')
            
            ->where([['adjobs.active',1]])
            ->groupBy('adjobs.id')
            ->get();                    

But it is only checking the first values (i.e) Adzuna expiry only, because it is grouped by Parent table id i.e adjobs.id. How to check all the three expiry date using above the query.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/35DtZH5
via IFTTT

Laravel migrate fresh specific migration

I'm trying to migrate some database tables in my Laravel application. I'm using a third party library https://github.com/spatie/laravel-schedule-monitor which seems to break and requires re-migrating when upgrading. If I run php artisan migrate:fresh locally it'll work just fine, but amongst all of my other migrations I don't want to overwrite and dump the data in my other tables in a production environment.

I want to migrate:fresh a specific migration...

UPDATE

When trying to run the refresh command on a table, the below happens...

monitors



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/36MKMqq
via IFTTT

How to use composite primary key in laravel 8?

I didn't use the migration files because I have preexisting tables in the database, I want to know how to force laravel to use my composite primary key.if there is any method to override. The composite primary key is (Tel + number_str ) This is my function in the model :

public function saveData(){
  $response = new ResponseModel(); 
                //Primary key(Tel + number_str )
                $reponse->Tel = '0123456789';//---> the first key
                $reponse->number_str = '1'; //---> the second key
    
                $reponse->view = '0';  
                $reponse->channal = '0';
                $reponse->save();
}

when I execute I have this error: Yajra\Pdo\Oci8\Exceptions\Oci8Exception Error Code : 904 Error Message : ORA-00904: "ID": invalid identifier Position : 98 Statement : insert into "REPONSE" ("TEL", "number_str", "view", "channal ") values (:p0, :p1, :p2, :p3) returning "ID" into :p4 Bindings : [0123456789,1,0,0,0]



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2IOh77V
via IFTTT

How to pass data id to modal?

i need to pass the dropdown id value once been selected. The id must be pass to modal.

This is my code for view :

<div class="panel panel-default">
    <div class="panel-heading">
        <h4></h4>
    </div>
    <div class="panel-body">
        <div class="form-horizontal">
            <label class="col-lg-2 control-label">{!! msg('lbl_education_level') !!}</label>
            <div class="col-lg-4">
                {!! Form::dropdown('education_level_id', $edulevelselection, '', 'class="select2-form edulevel"') !!}
            </div>
            <span>
                    {!! Form::buttonAdd('','#',[
                    'data-toggle' => 'modal',
                    'id' => 'education',
                    'data-title' => msg('lbl_new_academic_qualification'),
                    'data-target' => '#modal_global_form',
                    'data-url' => route('academic_qualification.create', [ 'id' => $staff_id] ),
                    'data-action' => route('academic_qualification.store'),
                    'data-size' => 'modal-lg',
                    'data-param' => '{ }'
                    ]) !!}
                </span>
        </div>
    </div>
</div>
@push('scripts')
<script type="text/javascript">

$('#education_level_id').change(function(e){
    var edulevelid = $('#education_level_id').val();
    console.log(edulevelid);
    $('#education').attr('data-param','{"education_level_id":'+edulevelid+'}');
})

</script>
@endpush

But the value i want is not show up, i do the dump() at the controller. it just show my id only. Supposedly from the dropdown form should include in the dump. This is the dump i make on the controller:

enter image description here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3pLHOLM
via IFTTT

Why Laravel Sanctum SPA Authentication always keep the user logged in?

I used Laravel Sanctum SPA authentication. I can log out the user but I am wondering why is it that the user is still logged in even when I close the browser. I don't even implement the remember me function.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3faF5q7
via IFTTT

How to send SMS using firebase in laravel

I am developing a laravel application,in which while user register, i want to send the registration code through SMS, i don't want to use any paid services.I heard about firebase free SMS gateway. Is there any option to send SMS through firebase



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32S92Gv
via IFTTT