jinsonjose

jinsonjose

Member Since 9 Months Ago

Experience Points
28,640
Total
Experience

1,360 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
271
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 6
28,640 XP
Mar
27
6 days ago
Activity icon

Started a new Conversation How To Get Another Table Data Can Be Select

my query

            $limt_contact_list = SectorContact::select('sectors.id AS sector_id', 'sectors.name AS sector_name', 'sectors.dx_no AS dx_no', 'sector_contacts.id AS contact_id','sector_contacts.title AS contact_title','sector_contacts.first_name AS first_name','sector_contacts.last_name AS last_name','sector_contacts.email AS email')
                      ->where('sector_contacts.sector_type', 1)
                      ->where(function($query) use($sc_data) {
                        // search the word on table sectors where sector_type = 4
                        $query->where('sector_contacts.first_name', 'LIKE', '%' . $sc_data['first_name'] . '%')
                            // ->orWhere('sector_contacts.first_name', 'LIKE', '%' . $sc_data['first_name'] . '%')
                            ->Where('sector_contacts.last_name', 'LIKE', '%' . $sc_data['last_name'] . '%')
                            ->Where('sector_contacts.email', 'LIKE', '%' . $sc_data['email'] . '%')
                            // check bdms (belongs relation to bdms table) name in bdms table
                            ->WhereHas('sectors', function (Builder $query) use($sc_data) {
                                $query->where('sectors.name', 'LIKE', '%' . $sc_data['sector_name'] . '%')
                                    ->Where('sectors.dx_no', 'LIKE', '%' . $sc_data['dx_no'] . '%');
                            });
                        })
                        ->get()
                        ->toJson();

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sectors.id' in 'field list' (SQL: select sectors.idassector_id, sectors.nameassector_name, sectors.dx_noasdx_no, sector_contacts.idascontact_id, sector_contacts.titleascontact_title, sector_contacts.first_nameasfirst_name, sector_contacts.last_nameaslast_name, sector_contacts.emailasemailfromsector_contactswheresector_contacts.sector_type = 1 and (sector_contacts.first_nameLIKE %T% andsector_contacts.last_nameLIKE %Bentley% andsector_contacts.emailLIKE %[email protected]% and exists (select * fromsectorswheresector_contacts.sector_id=sectors.idandsectors.nameLIKE %% andsectors.dx_noLIKE %% andsectors.deleted_atis null)) andsector_contacts.deleted_at is null)

the issue is whereHas Values is not getting in select how to solve ??

any ideas??

Mar
26
1 week ago
Activity icon

Replied to Huge Array Data Duplication Checking Shows Execution Time Exceeded

@cliffordatcaveodotnl my purpose is compare table fields and data may be different in some cases only email and dx_no same so distinct() is not work in this scenario

Activity icon

Replied to Huge Array Data Duplication Checking Shows Execution Time Exceeded

@cliffordatcaveodotnl how to do that?

checking for duplicates on these all selected fields

select('s.id AS sector_id', 'c.id AS contact_id', 's.name AS sector_name', 's.dx_no AS dx_no', 'c.title AS contact_title', 'c.first_name AS first_name', 'c.last_name AS last_name', 'c.email AS email')

how to filter using query ?

can you give me an example ??

Activity icon

Started a new Conversation Huge Array Data Duplication Checking Shows Execution Time Exceeded

$contact_list = DB::table('sector_contacts AS c') ->leftJoin('sectors AS s', 'c.sector_id', '=', 's.id') ->select('s.id AS sector_id', 'c.id AS contact_id', 's.name AS sector_name', 's.dx_no AS dx_no', 'c.title AS contact_title', 'c.first_name AS first_name', 'c.last_name AS last_name', 'c.email AS email') ->where('c.sector_type', 1) ->get() ->toJson();

$contact_list contains around 15000 records in below second foreach extract checking shows error like Maximum execution time of 60 seconds exceeded , also increases the maximum execution time upto 10 minute but same exception happening Maximum execution time of 600 seconds exceeded how to solve this

foreach ($contact_json as $sc_data) { foreach ($contact_json as $sc_data1) { // code } }

could you help??

Mar
17
2 weeks ago
Activity icon

Started a new Conversation Default Laravel Login Redirect To .map Instead Of Home

using laravel default login redirect to

http://127.0.0.1:8000/frontend/material/scss/icons/material-design-iconic-font/css/materialdesignicons.min.css.map instead of http://127.0.0.1:8000/home

in my project used laravel + vue

in web.php used Route::get('{path}','[email protected]')->where( 'path', '([A-z\d-/_.]+)?' ); when removing this link its have no issues but if it removed when refreshing vue page get 404 error how to solve this

in laravel deafault login have no change

using laravel version "laravel/framework": "^6.2", any idea??

Mar
12
3 weeks ago
Activity icon

Replied to Router-link Not Converted To <a></a> Tag Why ??

@spyworld how to resolve this issue? any suggestions??

Activity icon

Started a new Conversation Router-link Not Converted To <a></a> Tag Why ??

in app.js

`require('./bootstrap'); import router from './router';

window.Vue = require('vue');

const app = new Vue({ el: '#app', router });`

in router.js

`import Vue from 'vue'; import VueRouter from 'vue-router';

// import vue components import Home from './components/Home'; import User from './components/User'; import Profile from './components/Profile';

Vue.use(VueRouter);

export default new VueRouter({ routes: [ { path: '/home', component:Home }, { path: '/user', component:User }, { path: '/profile', component:Profile } ], mode: 'history' });`

in Home.vue' Home Component

                <div class="card-body">
                    I'm an home component.
                </div>
            </div>
        </div>
    </div>
</div>
export default { mounted() { console.log('Component mounted.') } } `

in master.blade.php

<router-link to="/home" class="waves-effect waves-dark" ><i class="mdi mdi-gauge"></i>Home</router-link>

Activity icon

Replied to Laravel Airlock 401 Unauthorized Error

@josoye24

after set AIRLOCK_STATEFUL_DOMAINS=127.0.0.1:8000 on .env file succesfully getting the details

nb :project run in portnumber 127.0.0.1:8000

its worked for me

Activity icon

Replied to GET Http://127.0.0.1:8901/api/user 401 (Unauthorized) Return Error Using Airlock

@jlafleur

i got the solution

vue and laravel in same project

after set AIRLOCK_STATEFUL_DOMAINS=127.0.0.1:8000 on .env file succesfully getting the details

nb :project run in portnumber 127.0.0.1:8000

thanks for your concern

Mar
10
3 weeks ago
Activity icon

Started a new Conversation GET Http://127.0.0.1:8901/api/user 401 (Unauthorized) Return Error Using Airlock

shows error on getting user details

GET http://127.0.0.1:8901/api/user 401 (Unauthorized)

<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="collapse navbar-collapse">
        <div class="navbar-nav">
            <button v-if="!loggedIn" @click="login">Login</button>
            <div v-else>
                <button @click="getUser">Get User</button>
                <button @click="logout">Logout</button>
            </div>
        </div>
    </div>
</nav>
<br/>

<script> import axios from 'axios'; axios.defaults.withCredentials = true; export default { data() { return { loggedIn:localStorage.getItem('loggedIn') == 'true' } }, methods: { login() { axios.get('/airlock/csrf-cookie').then(response => { axios.post('/api/login',{ email : 'jinsonjose007@gmail.com', password : '123456' }) .then(res => { localStorage.setItem('loggedIn','true'); this.loggedIn = 'true'; console.log(res); }) }); }, logout() { axios.post('/api/logout') .then(res => { localStorage.removeItem('loggedIn','true'); this.loggedIn = 'false'; }); }, getUser() { axios.get('/api/user').then(res => { console.log(res.data); }); } }, }; </script>

Accessing this route return Unauthorized error

Route::middleware('auth:airlock')->get('/user', function (Request $request) { return auth()->user(); });

error message on console

app.js:285 GET http://127.0.0.1:8901/api/user 401 (Unauthorized) dispatchXhrRequest @ app.js:285 xhrAdapter @ app.js:119 dispatchRequest @ app.js:765 Promise.then (async) request @ app.js:542 Axios.<computed> @ app.js:557 wrap @ app.js:1131 getUser @ app.js:1967 invokeWithErrorHandling @ app.js:42392 invoker @ app.js:42717 original._wrapper @ app.js:48076 app.js:699 Uncaught (in promise) Error: Request failed with status code 401 at createError (app.js:699) at settle (app.js:960) at XMLHttpRequest.handleLoad (app.js:168)

ogin and logout successfull why its happen??

Activity icon

Replied to User Authentication Using Vue And API - Lravel 6

@sti3bas

shows error on getting user details

GET http://127.0.0.1:8901/api/user 401 (Unauthorized)

Home
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="collapse navbar-collapse">
            <div class="navbar-nav">
                <button v-if="!loggedIn" @click="login">Login</button>
                <div v-else>
                    <button @click="getUser">Get User</button>
                    <button @click="logout">Logout</button>
                </div>
            </div>
        </div>
    </nav>
    <br/>
    
</div>
import axios from 'axios'; axios.defaults.withCredentials = true; export default { data() { return { loggedIn:localStorage.getItem('loggedIn') == 'true' } }, methods: { login() { axios.get('/airlock/csrf-cookie').then(response => { axios.post('/api/login',{ email : 'jinsonjose007@gmail.com', password : '123456' }) .then(res => { localStorage.setItem('loggedIn','true'); this.loggedIn = 'true'; console.log(res); }) }); }, logout() { axios.post('/api/logout') .then(res => { localStorage.removeItem('loggedIn','true'); this.loggedIn = 'false'; }); }, getUser() { axios.get('/api/user').then(res => { console.log(res.data); }); } }, };

hit this route shows unauthorized

Route::middleware('auth:airlock')->get('/user', function (Request $request) { return auth()->user(); });

login and logout successfull why its happen??

can you help

Activity icon

Replied to Laravel Airlock 401 Unauthorized Error

@faheemnz do you solve this issue, if solved please share ! how to solve ?

Mar
09
3 weeks ago
Activity icon

Replied to User Authentication Using Vue And API - Lravel 6

@sti3bas

kk sure update the result soon

thanks dude for the support

Activity icon

Replied to User Authentication Using Vue And API - Lravel 6

@sti3bas

is it?

{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.2", "fideloper/proxy": "^4.0", "laravel/framework": "^6.2", "laravel/tinker": "^2.0" }, "require-dev": { "facade/ignition": "^1.4", "fzaninotto/faker": "^1.9.1", "laravel/ui": "^1.0", "mockery/mockery": "^1.0", "nunomaduro/collision": "^3.0", "phpunit/phpunit": "^8.0" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "extra": { "laravel": { "dont-discover": [] } }, "autoload": { "psr-4": { "App\": "app/" }, "classmap": [ "database/seeds", "database/factories" ] }, "autoload-dev": { "psr-4": { "Tests\": "tests/" } }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { "post-autoload-dump": [ "Illuminate\Foundation\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-root-package-install": [ "@php -r "file_exists('.env') || copy('.env.example', '.env');"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ] } }

this is my composer.json is it support with this ?

Activity icon

Replied to User Authentication Using Vue And API - Lravel 6

@sinnbeck is that solution?? i will try and back u soon

thanks for the suggestion

also any tutorial please give suggestions

Activity icon

Replied to User Authentication Using Vue And API - Lravel 6

i already tried but in my project already installed some packages its not supported in upgradind to 7 that why i i ask for laravel6

Activity icon

Started a new Conversation User Authentication Using Vue And API - Lravel 6

how we can authorize the user through laravel +vue using api

laravel using version 6

i want to create a single page application on laravel + vue with login

Feb
26
1 month ago
Activity icon

Started a new Conversation ->withInput() Return On Try Catch() ??

in laravel controller how return ->withInput(); on try catch() when using in ->withInput(); page refreshed

    try { 
        $sector_contact    =  DB::select("SELECT $select_data
                                   FROM `sectors`
                                   JOIN `sector_contacts` ON sectors.id = sector_contacts.sector_id
                                   WHERE sectors.base_type= $base_type
                                   AND sectors.sector_type= $sector_type
                                   AND sector_contacts.deleted_at IS NULL 
                                   $sqlcondition");

    } catch(\Illuminate\Database\QueryException $ex) {
        // if query fail then return with query error
        return redirect('admin/sector-contact-export')
                        ->withErrors([$ex->getMessage()])
                        ->withInput(); 
    }

only this condition is working if not passing ->withInput() working fine but how to pass ->withInput()

    try { 
        $sector_contact    =  DB::select("SELECT $select_data
                                   FROM `sectors`
                                   JOIN `sector_contacts` ON sectors.id = sector_contacts.sector_id
                                   WHERE sectors.base_type= $base_type
                                   AND sectors.sector_type= $sector_type
                                   AND sector_contacts.deleted_at IS NULL 
                                   $sqlcondition");

    } catch(\Illuminate\Database\QueryException $ex) {
        // if query fail then return with query error
        return redirect('admin/sector-contact-export')
                        ->withErrors([$ex->getMessage()]);
                        // ->withInput(); 
    }
Activity icon

Started a new Conversation How To Import Xlsx File And Convert To Array Using Maatwebsite\Excel

in Maatwebsite\Excel using how to convert xlsx file to convert to array

my question is i have a excel file and its data to be a array

$collection = Excel::toArray(new SectorFileImport, $path); but the header also consider as an array also in my excel contains only 16 rows one is header but array returns as 1024

result is like below

array:1 [▼ 0 => array:16 [▼ 0 => array:1025 [▼ 0 => "name" 1 => "address1" 2 => "address2" 3 => "address3" 4 => "dx_no" 5 => "title" 6 => "fore_name" 7 => "sur_name" 8 => "job_title" 9 => "phone" 10 => "email" 11 => "dx_exchange" 12 => "town" 13 => "county" 14 => "country" 15 => "pin_code" 16 => "website" 17 => "contact_title" 18 => "contact_first_name" 19 => "contact_last_name" 20 => "contact_address" 21 => "contact_phone" 22 => "contact_fax" 23 => "contact_email" 24 => "contact_postion" 25 => null 26 => null 27 => null 28 => null 29 => null 30 => null 31 => null 32 => null 33 => null 34 => null 35 => null 36 => null 37 => null 38 => null 39 => null 40 => null 41 => null 42 => null 43 => null 44 => null 45 => null 46 => null 47 => null 48 => null 49 => null 50 => null 51 => null 52 => null 53 => null 54 => null 55 => null 56 => null 57 => null 58 => null 59 => null 60 => null 61 => null 62 => null 63 => null 64 => null 65 => null

total result array

array:1 [▼ 0 => array:16 [▼ 0 => array:1025 [▶] 1 => array:1025 [▶] 2 => array:1025 [▶] 3 => array:1025 [ …1025] 4 => array:1025 [ …1025] 5 => array:1025 [ …1025] 6 => array:1025 [ …1025] 7 => array:1025 [ …1025] 8 => array:1025 [ …1025] 9 => array:1025 [ …1025] 10 => array:1025 [ …1025] 11 => array:1025 [ …1025] 12 => array:1025 [ …1025] 13 => array:1025 [ …1025] 14 => array:1025 [ …1025] 15 => array:1025 [ …1025] ] ]

any answer or suggestions??

Feb
20
1 month ago
Activity icon

Started a new Conversation How To Create A Custom Password Reset

in laravel how to create custom password reset

like route controller handling and email with template

in default laravel using this route for reset {{ route('password.email')}} how to create and handle it custom

Feb
17
1 month ago
Activity icon

Replied to FPDF Package For Laravel

@sinnbeck

  1. codedge/laravel-fpdf
  2. crabbly/fpdf-laravel
  3. anouar/fpdf

so that the reason why i ask here

Activity icon

Started a new Conversation FPDF Package For Laravel

in laravel i want to use FPDF i use laravel 6 which package can be used in FPDF

Feb
13
1 month ago
Activity icon

Started a new Conversation How To Get Latitude And Longitude Based On Address (without Using Googleapi)

i used nominatim but the problem is gives [] https://nominatim.openstreetmap.org/?format=json&addressdetails=1&q={Studio%20103,The%20Business%20Centre,61%20Wellfield%20Road,Roath,Cardiff,CF24%203DG}&format=json&limit=1

this will give lat and long

https://nominatim.openstreetmap.org/?format=json&addressdetails=1&q={Studio%20103,61%20Wellfield%20Road,Roath,Cardiff,CF24%203DG}&format=json&limit=1

the output: [ { "place_id": 182054265, "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright", "osm_type": "way", "osm_id": 419550100, "boundingbox": [ "51.493995", "51.4958426", "-3.1661591", "-3.1650575" ], "lat": "51.4948835", "lon": "-3.1656815", "display_name": "Wellfield Road, Roath, Cardiff, Wales, CF, United Kingdom", "class": "highway", "type": "tertiary", "importance": 0.5199999999999999, "address": { "road": "Wellfield Road", "suburb": "Roath", "city": "Cardiff", "county": "Cardiff", "state": "Wales", "postcode": "CF", "country": "United Kingdom", "country_code": "gb" } }

the problem is given address is not formatted how to resolve this issue?? can you help??

Feb
12
1 month ago
Activity icon

Started a new Conversation SQLSTATE[23000]: Integrity Constraint Violation: 1052 Column 'name' In Where Clause Is Ambiguous

how to solve this errror query below sort and search have this occure this error

public function index()
{
    $search  = request('search_text');
    if ($search != NULL ) {
        // check any search word match 
        $users = User::where('name', 'LIKE', '%' . $search . '%')
                    ->orWhere('user_name', 'LIKE', '%' . $search . '%')
                    ->orWhere('email', 'LIKE', '%' . $search . '%')
                    // check roles (belongs relation to roles table) name in roles table
                    ->orWhereHas('roles', function (Builder $query) use($search) {
                        $query->where('name', 'LIKE', '%' . $search . '%');
                    })
                    // check base_types (belongs relation to base_types table) name in base_types table
                    ->orWhereHas('base_types', function (Builder $query) use($search) {
                        $query->where('name', 'LIKE', '%' . $search . '%');
                    })
                    ->sortable('name')
                    ->paginate(15);
                    
    } else {
        $users = User::sortable('name')->paginate(15);
    }
    return view('admin.users.index',compact('users', 'search'));
}

error message

Illuminate\Database\QueryException SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'name' in where clause is ambiguous (SQL: select count(*) as aggregate from users left join base_types on users.base_type = base_types.id where (name LIKE %uk% or user_name LIKE %uk% or email LIKE %uk% or exists (select * from roles where users.role_id = roles.id and name LIKE %uk%) or exists (select * from base_types where users.base_type = base_types.id and name LIKE %uk%)) and users.deleted_at is null)

                                <th>@sortablelink('name', 'Name')</th>
                                <th>@sortablelink('user_name', 'User Name')</th>
                                <th>@sortablelink('email', 'Email')</th>
                                <th>@sortablelink('roles.name', 'Role')</th>
                                <th>@sortablelink('base_types.name', 'Base Type')</th>
                                <th>@sortablelink('status', 'Status')</th>
                                <th>@sortablelink('updated_at', 'Modified')</th>
                                <th>@sortablelink('', 'Actions')</th>

in model relation

/**
 * get role name from Role Table
 * based on role_id
 */
public function roles()
{
    return $this->belongsTo('App\Role','role_id');
}

/**
 * get base type name from BaseType Table
 * based on base_type
 */
public function base_types()
{
    return $this->belongsTo('App\BaseType','base_type');
}
Feb
10
1 month ago
Activity icon

Started a new Conversation Column Sorting In Laravel Paginate On Table

how to sort table column with the laravel paginate

in controller fetch data with paginate()

$council = Sector::where('sector_type',3)->orderBy('id', 'desc')->paginate(15);

in blade

                    <table  class="table table-bordered table-striped" style="border: 1px solid #dee2e6;">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Address</th>
                                <th>Town</th>
                                <th>Base Type</th>
                                <th>Status</th>
                                <th style="width:13%;">Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            @if(!$council->isEmpty())
                            @foreach($council as $councils)
                            <tr>
                                <td> {{ $councils->name }} </td>
                                <td>
                                    {{ $councils->address1 }}
                                </td>
                                <td>{{ $councils->town }}</td>
                                <td>{{ $councils->baseType->name }}  </td>
                                <td> 
                                </td>
                                <td>
                                </td>
                            </tr>
                            @endforeach
                            @else
                            <td colspan="6"> No data available in table</td>
                            @endif
                        </tbody>
                    </table>

{!! $council->appends(\Request::except('page'))->render() !!}

how to apply sort on this table in laravel 6 nb : please avoid datatable technique i want to use normal table

Feb
05
1 month ago
Activity icon

Replied to Search With In A Where Condition On Laravel

thanks for your quick replay

little updation

passing also use($search) in function

        $search  = request('search_text');
        $council = Sector::where('sector_type', 3)
                         ->where(function($query) use($search) {
                            $query->where('name', 'LIKE', '%' . $search . '%')
                                ->orWhere('address1', 'LIKE', '%' . $search . '%')
                                ->orWhere('address2', 'LIKE', '%' . $search . '%')
                                ->orWhere('address3', 'LIKE', '%' . $search . '%')
                                ->orWhere('job_title', 'LIKE', '%' . $search . '%')
                                ->orWhere('town', 'LIKE', '%' . $search . '%');
                        })
                        ->paginate(15);
Activity icon

Started a new Conversation Search With In A Where Condition On Laravel

in my table "sector" , one filed name is sector_type its values are1,2,3,4, etc....... i want to search string where sector_type=3 only how to write query in laravel search on fields name,address1,address2,address3,jobtitle,town

purpose : serach the text only in sector_type = 3 but below query return all results where sector_type = 3 how to solve this issue? can you help?

    $search  = request('search_text');
        $council = Sector::where('sector_type', 3)
                        ->orWhere('name', 'LIKE', '%' . $search . '%')
                        ->orWhere('address1', 'LIKE', '%' . $search . '%')
                        ->orWhere('address2', 'LIKE', '%' . $search . '%')
                        ->orWhere('address3', 'LIKE', '%' . $search . '%')
                        ->orWhere('job_title', 'LIKE', '%' . $search . '%')
                        ->orWhere('town', 'LIKE', '%' . $search . '%')
                        ->paginate(15);
Dec
30
3 months ago
Activity icon

Replied to Laravel Roles And Permission

thanks dude for the replay,

actually first time i using spatie that why i take an opinion about to use the package actually i didnt find any disadvantages! i know in this community , so many using this so that reason i ask an opinion about spatie

thanks for your replay

Activity icon

Started a new Conversation Laravel Roles And Permission

in laravel 6 which one is the best way for managing roles and permission can you suggest me the best way? in my search i found that spatie if i use this package any dis advantages can you suggest me the better way for doing this?