ReakyMark

ReakyMark

Member Since 1 Year Ago

Experience Points 4,020
Experience Level 1

980 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 23
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

09 Aug
1 week ago

ReakyMark started a new conversation Weird Queue Stuck And It Work As Normol On Tomorrow

Hi, i got problem just yesterday not sure what exactly cause my schedule queue stuck and it start working as normol on next day , i didint do anything.

My Queue drive : Database Cronjob: laravel schedule 

this is code i use to do my mail queue

$schedule->command('queue:restart')->hourly();
$schedule->command('queue:work --sleep=5 --tries=3 --queue=high,default,low')
        ->name('start_queue_job')
        ->withoutOverlapping()
        ->everyMinute();

as i research google some say about storage cache permission, other say mayby memory leak etc

And how can i log memory useage with my current schedule code ?

Please kindly advice, Thank in advance.

23 Nov
8 months ago

ReakyMark started a new conversation How To Remove Index.php From Url

i don't know why sometime i enter url in browser bar it take me to url that has index.php in url and it make my image not show. example:

my image path: https://domain.com/upload/image.jpg

but when in url has index.php it give the path https://domain.com/index.php/upload/image.jpg

how can i fix this all my image not load when it has index.php in url ?

this is my httaccess

<IfModule mod_rewrite.c>

    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Header set Content-Security-Policy: upgrade-insecure-requests
11 Nov
9 months ago

ReakyMark left a reply on Laravel Validate Error Return Status 200 Instead Of 422 In Ajax

@USMAN - i'm on Laravel 5.5.* (on Backpack 3.4) not Laravel 5.7 and didn't use any dump-server. it just hard to find the source of problem while local return 422 and server return 200 status while on validate error (same code)

ReakyMark started a new conversation Laravel Validate Error Return Status 200 Instead Of 422 In Ajax

I'm out of idea what this problem come from, while on local i send request by ajax and validate error it return 422 as excepted but when i'm upload my code to server when validate error in ajax it return 200 instead of 422 but it has all error message in response. anyone met this kind of problem ?

06 Aug
1 year ago

ReakyMark left a reply on Laravel Mimes Validate Not Fully Working. Pleaes Help

@CronjeCor i have try |mimetypes:image/jpeg,image/jpg it still the same.maybe i have to add custom code to my upload function else my DB will be broken :D

ReakyMark started a new conversation Laravel Mimes Validate Not Fully Working. Pleaes Help

it weird to me. when my validate is ....|mimes:jpeg,jpg,png,gif, I had 2 main file for test: test.htm and test.jpg so i copy test.jpg and rename their extension.

Final file i had

test.html    (html file)
test.jpg       (image file)
test.asd      (image file)

if i upload test.html yes it error wrong mimes. Ok

if i upload image file i copy before and rename their extension to asd. test.asd my validate mimies stop working it let this file pass. what wrong in this ? No error mimes given and pass

Please help Thank in advance.

04 Aug
1 year ago

ReakyMark left a reply on Why My Phone Field Can't Be Except Id In Unique ?

my mistake 2 old record left after i just update my rule

ReakyMark started a new conversation Why My Phone Field Can't Be Except Id In Unique ?

i have 2 field for identify field it ok to except exceptId , but for phone field it can't be except i had no idea what wrong i don't want to validate self unique in update request.

$exceptId = $this->route('customer')->id ?? '';

 'customer_phone' 
=>
 'required|numeric|digits_between:9,11|unique:customers,customer_phone,'.$exceptId,
 'customer_identify'
=> 
'required|numeric|digits_between:6,50|unique:customers,customer_identify,'.$exceptId,

so my customer_phone alway error has been taken if i have give $exceptId but customer_identify it can be except.

Thank in advance.

01 Aug
1 year ago

ReakyMark started a new conversation Hi Guy How Can I Backup Extra Folder In Spatie/laravel-backup On Hosting?

in local host yes it backup all my db with all files.but when i host it i need to seperate setup.

/Home/user
/Home/user/laravel

this sub_domain folder is where all file in public folder copy.

/Home/user/public_html/sub_domain

i success backup but it only take /Home/user/laravel with mysqldump only i missing files on my /Home/user/public_html/sub_domain.

this is my controller backup

\Artisan::call('backup:run');
$output = \Artisan::output();
         
\Log::info("New backup started from admin interface \r\n" . $output);


            return redirect()->back()->with(
                'success',
                'New backup created.'
            );

Please help Thank in advance.

15 Jul
1 year ago

ReakyMark left a reply on Hi Guy How To Can Use Collection Method Inside Chunk() Callback?

@bobbybouwmann how can i chunk relationship ? because when i set Book table as main$books = Book::with(['schedules', 'customer'])->get(); do i using chunk like this ?

@foreach($book->schedules->chunk(100) as $schedules)
    @foreach($schedules as $s)
        .........
    @endforeach
@endforeach

or using chunk callback ?

does chunk callback and chunk collection is same ?

14 Jul
1 year ago

ReakyMark started a new conversation Hi Guy How To Can Use Collection Method Inside Chunk() Callback?

i had load 10000 record from schedule so i need to chunk it else it error memory limited. i want to get Total Sum of schedule_type to compare both free & premium. My model

$data = Schedule::with(['customer'])
            ->whereYear('schedule_date', '=', $year)
            ->whereMonth('schedule_date', '=', $month)
            ->orderBy('id', 'asc');
$data->chunk(100, function ($row) use (
    &$sumFree,
    &$sumPremium       
) {
foreach($row as $r):
......
endforeach;
});

if normal data without chunk i can get it like this:

// this query with small amount of data in DB if Large it can't be use
$data = Schedule::with(['customer'])
            ->whereYear('schedule_date', '=', $year)
            ->whereMonth('schedule_date', '=', $month)
            ->orderBy('id', 'asc')
            ->get();

$sumFree = collect($data)->where('schedule_type', 'free')->sum('book_pay');
$sumPremium = collect($data)->where('schedule_type', 'premium')->sum('book_pay');

so How can i do collect where and sum them when my data is inside chunk?

12 Jul
1 year ago

ReakyMark left a reply on Is There Anyway To Hide Parent Record By Relationship? In WhereHas Very Poor Performance.

@lostdreamer_nl Thank by the way i got your concept and change it a little now it faster :D maybe whereHas do query difference from what i expect. here is my working now with 10000 record in book_schedule and show 5 Book by check that book_schedule->status

 $bookSchedule = \App\BookSchedule::where('schedule_status', 'Pending')->pluck('book_id')->unique();
    
        $books=\App\Book::
            whereIn('id', $bookSchedule )
            ->where('book_type', $bookType)
            ->with(['customer', 'schedulePending'])
            ->orderBy('id', 'desc')
            ->paginate(5);

ReakyMark started a new conversation Is There Anyway To Hide Parent Record By Relationship? In WhereHas Very Poor Performance.

for small data it ok to use whereHas but when i test Faker to insert 10000 record my site stop working it Maximum execution time of 60 seconds exceeded, if i remove all record everything working fine, is there alternate way to achieve this ?

example i had Book, Book_scheduleso i need to show which Book that nearly to return back by book_schedule.

this is my code work but it problem when in large DB

Model
return $this->hasMany('\App\BookSchedule')
            ->where('schedule_status', '=', 'Pending');


Controller
$books= \App\Book::whereHas('bookScheduleCheckPending')
            ->where('book', $bookType)
            ->with(['customer', 'bookScheduleCheckPending'])
            ->orderBy('id', 'desc')
            ->paginate(5);

with 5 record if any Book that no Pending in schedule_status mustn't in my Book collection with paginate 5.

Thank in advance.

07 Jul
1 year ago

ReakyMark started a new conversation How To Check $request->hasFile('attachment') And Custom Message Error Localization In Request FIle ?

I have research many hour but still can't find any related document to my problem most are validate inside controller not in Request File.

i don't use validate in controller i seperate it to Request File everything ok it just i can't check if input submit is File before i custom error message in public function messages(){}.

i had temporary solution but if i test change type="file" to type="text" it will broken return 500 because i didn't check it is a file or not$this->hasFile('attachment') not work in Request File.

public function messages() {
    if (count($this->attachment) > 0) {
            foreach($this->attachment as $key => $val) {
                $messages['attachment.'.$key.'.image'] = 'File '.$val->getClientOriginalName().' must be an image.';
            }
        }
}

  1. how can i use hasFile() inside messages() ?

  2. how can i make localization errors custom message in Request File ?

24 Jun
1 year ago

ReakyMark left a reply on How To Get Laravel Validate Error Field.* In Js ?

@rin4ik i have watch that video 3 part already but it just single field validate.

example my input file will let user upload multiple so i can't write code to guess their total upload so i have to loop customer_attachment but i dunno how can i count that field length while the json it return like this

{
  "message": "The given data was invalid.",
  "errors": {
    "customer_name": [
      "The customer name field is required."
    ],
    "customer_phone": [
      "The customer phone field is required."
    ],
    "customer_address": [
      "The customer address field is required."
    ],
    "customer_attachment.0": [
      "The customer_attachment.0 must be an image.",
      "The customer_attachment.0 must be a file of type: jpeg, jpg, gif, png."
    ],
    "customer_attachment.1": [
      "The customer_attachment.1 must be an image.",
      "The customer_attachment.1 must be a file of type: jpeg, jpg, gif, png."
    ]
  }
}

as u can see there are multiple image from customer_attachment coming along with dot and index number so i can't guess their total upload file by errors.['customer_attachment'][0] and errors.['customer_attachment'][1] that is what i want ask how can i do that and loop all of customer_attachment to show under input file field.

ReakyMark started a new conversation How To Get Laravel Validate Error Field.* In Js ?

how can i show each error to each input field i can only select error that not array from validate like this field.* => '' i dunno how to get this error field, but for this i can get field => ''.

this is error console.log i got from if (error.response.status === 422) { console.log(error.response.data.errors); }

customer_attachment.0
:
(2) ["The customer_attachment.0 must be an image.", "The customer_attachment.0 must be a file of type: jpeg, jpg, gif, png."]
customer_attachment.1
:
(2) ["The customer_attachment.1 must be an image.", "The customer_attachment.1 must be a file of type: jpeg, jpg, gif, png."]
customer_age
:
["The customer age field is required."]

how could i loop to get value from customer_attachment.0 & .1 ?

ReakyMark left a reply on How To Send Input File Multiple With Javascript FormData To Laravel ?

i found solution remove all formData.append and replace by 1 line only

var formData = new FormData($(this.createForm)[0]);

axios.post(`${baseUrl}/api/customer`, formData)
.then((res) => {
      alert('ok');
});

but can anyone guide me about my problem code above ? i wanna know cause of the problem

ReakyMark started a new conversation How To Send Input File Multiple With Javascript FormData To Laravel ?

i got no idea how to send <input type="file" id="customer-attachment" name="customer_attachment[]" class="form-control choose-file" multiple> to let laravel check it by if ($request->hasFile('customer_attachment')) { return 'got file'; }

Js file

import axios from 'axios';

var customers = {
  createForm: '#customer-form',
  init: function () {
    $(document).on('submit', this.createForm, function(e) {
      e.preventDefault();
      customers.createUser();
    });
  },
  createUser: function () {
    var formData = new FormData();
   
    formData.append('customer_name',$('#customer-name').val());
    formData.append('customer_gender',$('#customer-gender').val());
    formData.append('customer_phone',$('#customer-phone').val());
    formData.append('customer_address',$('#customer-address').val());
    var fileList = $('#customer-attachment').get(0).files;
    
    if (fileList.length > 0) {
      for (let i = 0; i < fileList.length; i += 1) {
        formData.append('customer-attachment[]', fileList[i]);
      }
    }
    
    axios.post(`${baseUrl}/api/customer`, formData)
      .then((res) => {
        alert('ok');
      });
  }
};

export default $(function () { customers.init(); })

file payload got when do axios submit

------WebKitFormBoundarySFCYaZVLj2dl2tGO
Content-Disposition: form-data; name="customer-attachment[]"; filename="4R7A8181.JPG"
Content-Type: image/jpeg


------WebKitFormBoundarySFCYaZVLj2dl2tGO
Content-Disposition: form-data; name="customer-attachment[]"; filename="Untitled-1.jpg"
Content-Type: image/jpeg


------WebKitFormBoundarySFCYaZVLj2dl2tGO--

how can i send input file multiple to laravel with javascript ?

29 May
1 year ago

ReakyMark left a reply on How Can I Use Name Field To Login Instead Of Email Field In Laravel Auth ?

@hdsavani yes i change to use manual authorication now it work

$credentials = $request->only('name', 'password');

        if (Auth::attempt($credentials)) {
            // Authentication passed...
            return redirect()->intended('admin/dashboard');
        }
        return redirect()->back()->with('error', 'username or password incorrectly!!!');

and i have 1 more question i see in Official Laravel Doc they use this code redirect()->intended('admin/dashboard') what this difference to this 1 redirect('admin/dashboard') ? or it has same effect just developer preference ?

ReakyMark left a reply on How Can I Use Name Field To Login Instead Of Email Field In Laravel Auth ?

@jenky it not about guard if i change name back to email it work but if i want to change email to name it not work.

28 May
1 year ago

ReakyMark started a new conversation How Can I Use Name Field To Login Instead Of Email Field In Laravel Auth ?

I have override in Login Controller but it still not log me in except i switch to use email. because my old DB is use name so i doesn't register with email that the reason i want to change email to name for login.

my Admin\Login

use AuthenticatesUsers;

    protected $redirectTo = '/admin/dashboard';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    /*
     * Override default config
     */

    protected $username = 'name';
    
    public function showLoginForm()
    {
        return view('auth.admin.login');
    }

    public function username()
    {
        return 'name';
    }

my login blade

<form method="post" action="{{ route('admin.login') }}">
                    {{ csrf_field() }}
                    <input type="text" name="name" placeholder="Username">
                    @if ($errors->has('name'))
                        <span class="help-block">
                            <strong>{{ $errors->first('name') }}</strong>
                        </span>
                    @endif

                    <input type="password" name="password" placeholder="Password">
                    @if ($errors->has('password'))
                        <span class="help-block">
                            <strong>{{ $errors->first('password') }}</strong>
                        </span>
                    @endif

                    <input type="submit" name="but_login" value="Login" class="loginmodal-submit">

                </form>

this is my custom route for admin login, Route.php

Route::group([
    'prefix' => 'admin',
    'as' => 'admin'
], function () {
    require base_path('routes/admins/web.php');
    require base_path('routes/logins/web.php');
});

this is my logins/webs.php

Route::get(
    'login',
    'Auth\Admin\[email protected]'
)->name('.login');

Thank in advance.

24 May
1 year ago

ReakyMark started a new conversation How Can I Make This Function Reuse In Laravel For All My BaseController ?

i had 2 baseController: FrontController, AdminController currently i pass that function to both base controller.

class AdminController extends Controller
{
    protected $varShare;

    public function __construct()
    {
        .......
     }
     ......
     ......
    protected function setNewFileName($requestFile, $name)
    {
        $extension = $requestFile->getClientOriginalExtension();
        $fileNameFormat = str_slug($name, '-').'-'. date("m-d-Y") .'-'. time().'.'.$extension;
        return $fileNameFormat;
    }
}

as u can see above code i had some function that call AdminController::setNewFileName(...) in Controller that extends it but i want it make it only 1 place and can reuse it in both my baseController..

Please guide me Thank in advanced.

ReakyMark started a new conversation How Does Migration Function Work ?

Please help clarify me about Migration up() and down().

all code in up() will execute when we call php artisan migrate:refresh

all code in down() will execute when we call php artisan migrate:reset

Am i right ?

Thank in advanced.

03 May
1 year ago

ReakyMark left a reply on Vue Why Props And Data Use Same Syntax As This.test?

@wilburpowery look like naming in Vue must be more careful else i'm dead for sure lol that not easy to found out when code grow

ReakyMark started a new conversation Vue Why Props And Data Use Same Syntax As This.test?

i'm a little bit confuse how Vue get value from Props / data() ?

get value from data()

export default {
data() {
return {test: 1};
}
render(h) {
return (
    <div>{this.test}</div>
);
}
}

get value from props

<Test test={this.test}/>

export default {
props: ["test"],
render(h) {
return (
    <div>{this.test}</div>
);
}
}

while in React they access it by this.state or this.props how Vue determine which is props or value from data() while they use same syntax ?

Correct me if i'm wrong.

Thank in advanced.

02 May
1 year ago

ReakyMark started a new conversation Vue Why Destroyed() Not Fire ? I'm Wrong ?

i'm new to Vue and just copy React code to Vue and make it work in Vue yes it work but i wonder why destroyed() not fire ? this is my Vue code

export default {
    data: function() {
        return {
            itemShow: false,
            intervalId: 0,
        };
    },
    mounted() {
        window.addEventListener('scroll', this.handleScroll);
        console.log('listener has been add');
    },
    destroyed() {
        window.removeEventListener('scroll', this.handleScroll);
        console.log('listener has been remove');
    },
    methods: {
        handleScroll() {
            const { body } = document;
            const html = document.documentElement;
            const windowHeight = 'innerHeight' in window ? window.innerHeight : html.offsetHeight;
            const docHeight = Math.max(
            body.scrollHeight,
            body.offsetHeight,
            html.clientHeight,
            html.scrollHeight,
            html.offsetHeight,
            );
            const windowBottom = windowHeight + window.pageYOffset + 200;
            if (windowBottom >= docHeight) {
                this.itemShow = true;
            } else {
                this.itemShow = false;
            }
            console.log(`handleScroll: ${this.intervalId}`);
        },
        scrollStep() {
            const pageYOffSet = window.pageYOffset;
            const scrollRequest = window.requestAnimationFrame ||
            window.webkitRequestAnimationFrame ||
            window.mozRequestAnimationFrame ||
            window.oRequestAnimationFrame ||
            window.msRequestAnimationFrame ||
            ((callback) => { window.setTimeout(callback, 1000 / 60); });

            if (pageYOffSet === 0) {
                    clearInterval(this.intervalId);
            }
            scrollRequest(() => {
                window.scrollTo(0, pageYOffSet - 120);
            });
            console.log(`GoToTop: ${this.intervalId}`);
        },
        scrollToTop() {
            const intervalId = setInterval(this.scrollStep, 20);

            this.intervalId = Number(intervalId);
        }
    },
    render(h) {
        let ShowOrHide = 'show';
        if (this.itemShow === false) {
            ShowOrHide = 'hide';
        }
        return (
            <div class={`scroll-to-top ${ShowOrHide}`} onClick={this.scrollToTop}>
                <i class="fa fa-angle-up" />
                a
            </div>
        );
    },
};

this console.log scroll to bottom and click GoToTop

listener has been add

68 handleScroll: 0
GoToTop: 5
handleScroll: 5
2  GoToTop: 5
handleScroll: 5
 GoToTop: 5
handleScroll: 5
GoToTop: 5
2 handleScroll: 5
2 GoToTop: 5
handleScroll: 5
GoToTop: 5
handleScroll: 5
GoToTop: 5
handleScroll: 5

ReakyMark started a new conversation Please Guide Me Some Of Vue Setup And Tip

I'm new to Vuejs, myself is from React so i'm a little familar with Vue render function i had a few question that i'm still confuse and hard to find reference.

  1. Vue build Compile or run time or full build which is suit my use case of render function i don't like template ?

  2. i research on google it has only a few document or use case for Vue render function JSX, if has can you provide me a link ?

  3. any using VS Code can guide me extension for Vue suit my render function use case ? i need syntax Highlight, snippet and other to prevent typo :P ?

  4. while i'm going to use render function jsx which file type for it .js or .vue ?

Thank in advanced for guiding me.

03 Apr
1 year ago

ReakyMark started a new conversation How To Use Laravel Passport For Api From Mobile?

I am new to security after search and i just want to add security to my api for mobile request but i am stuck at using laravel Passport i have successfully install Laravel Passport with Laravel 5.5.

but in the doc i don't see any example for simple usage.so i search other but alway {"error":"Unauthorised"}.

PassportController

public $successStatus = 200;

    public function login()
    {
        if (Auth::attempt(['email' => request('email'), 'password' => request('password')])) {
            $user = Auth::user();
            $success['token'] =  $user->createToken('MyApp')->accessToken;
            return response()->json(['success' => $success], $this->successStatus);
        } else {
            return response()->json(['error'=>'Unauthorised'], 401);
        }
    }
    public function register(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'name' => 'required',
            'email' => 'required|email',
            'password' => 'required',
            'c_password' => 'required|same:password',
        ]);

        if ($validator->fails()) {
            return response()->json(['error'=>$validator->errors()], 401);
        }

        $input = $request->all();
        $input['password'] = bcrypt($input['password']);
        $user = UserApi::create($input);
        $success['token'] =  $user->createToken('MyApp')->accessToken;
        $success['name'] =  $user->name;

        return response()->json(['success'=>$success], $this->successStatus);
    }

    public function getDetails()
    {
        $user = Auth::user();
        return response()->json(['success' => $user], $this->successStatus);
    }

UserApi Model

class UserApi extends Authenticatable
{
    use HasApiTokens, Notifiable;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $table = 'users';
    protected $fillable = [
        'name', 'email', 'password',
    ];
    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];
}

users table

id
name
email
password
remember_token
created_at
updated_at

Api route

Route::post('login', 'Api\[email protected]');
Route::post('register', 'Api\[email protected]');

Route::group(['middleware' => 'auth:api'], function () {
    Route::post('test', 'Api\[email protected]');
});

auth config

'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'passport',
            'provider' => 'usersApi',
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Model\AdminPanel\User::class,
        ],
        'usersApi' => [
            'driver' => 'eloquent',
            'model' => App\Model\UserApi::class,
        ],
        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

Thank in advanced.

30 Mar
1 year ago

ReakyMark started a new conversation Help Laravel Jwt Error Unauthorize Did I Wrong Install

Laravel 5.5, "tymon/jwt-auth": "1.0.0-rc.1" i dunno what wrong i have install and but when i use postman to send email: [email protected] and password: secret by post to app.laravel/api/auth/login i got error

{"error": "Unauthorized"}

this is my setup auth.php

 'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'jwt',
            'provider' => 'api_users',
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Model\AdminPanel\User::class,
        ],
        'api_users' => [
            'driver' => 'eloquent',
            'model' => App\Model\UserApi::class,
        ],
    ],

this AuthController from JWT doc

<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;

class AuthController extends Controller
{
    /**
     * Create a new AuthController instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth:api', ['except' => ['login']]);
    }

    /**
     * Get a JWT via given credentials.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function login()
    {
        $credentials = request(['email', 'password']);

        if (! $token = auth()->attempt($credentials)) {
            return response()->json(['error' => 'Unauthorized'], 401);
        }

        return $this->respondWithToken($token);
    }

    /**
     * Get the authenticated User.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function me()
    {
        return response()->json(auth()->user());
    }

    /**
     * Log the user out (Invalidate the token).
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function logout()
    {
        auth()->logout();

        return response()->json(['message' => 'Successfully logged out']);
    }

    /**
     * Refresh a token.
     *
     * @return \Illuminate\Http\JsonResponse
     */
    public function refresh()
    {
        return $this->respondWithToken(auth()->refresh());
    }

    /**
     * Get the token array structure.
     *
     * @param  string $token
     *
     * @return \Illuminate\Http\JsonResponse
     */
    protected function respondWithToken($token)
    {
        return response()->json([
            'access_token' => $token,
            'token_type' => 'bearer',
            'expires_in' => auth()->factory()->getTTL() * 60
        ]);
    }
}

AuthController route

Route::group([

    'middleware' => 'api',
    'prefix' => 'auth'

], function ($router) {

    Route::post('login', '[email protected]');
    Route::post('logout', '[email protected]');
    Route::post('refresh', '[email protected]');
    Route::post('me', '[email protected]');

});

this is my UserApi model

<?php

namespace App\Model;

use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class UserApi extends Authenticatable implements JWTSubject
{
    use Notifiable;
    /**
     * Get the identifier that will be stored in the subject claim of the JWT.
     *
     * @return mixed
     */
    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    /**
     * Return a key value array, containing any custom claims to be added to the JWT.
     *
     * @return array
     */
    public function getJWTCustomClaims()
    {
        return [];
    }
}

this is my users table

public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

Help please Thank in advanced.

18 Mar
1 year ago

ReakyMark left a reply on Laravel 5.5 API Resource Why It Load Data From Relationship But In My Controller No Passing Relationship

@shez1983 i see they check isAdmin or not but i wonder how they pass isAdmin from where or they create isAdmin method inside Resource file or pass from controller in doc no mention where it from. or it core helper of laravel if so how we custom our own method to check ? in this ?

17 Mar
1 year ago

ReakyMark left a reply on Laravel 5.5 API Resource Why It Load Data From Relationship But In My Controller No Passing Relationship

@shez1983 Thank it solve my problem and another question

  1. where isAdmin() method come from ? $this->when($this->isAdmin(), 'secret-value') where they pass it to Resource ?
  2. Resource is for adding attribute, ResoureCollection is for adding meta am i right ?

ReakyMark started a new conversation Laravel 5.5 API Resource Why It Load Data From Relationship But In My Controller No Passing Relationship

  1. how can i validate if relation has or not to append field specific on API Change ?
  2. how this access directly with relationship in my Model Folder because i didn't provide any with('relationship') with my code ?

this is my controller

 public function loadCategoryForFirmware()
    {
        $firmware = Category::orderBy('category_id', 'desc')->get();

        return CategoryResource::collection($firmware);
    }

this is my Resource

public function toArray($request)
    {
        return [
            'id' => $this->category_id,
            'name' => $this->category_name,
            'count' => $this->firmwares_count,
            'firmwares' => $this->when(isset($this->firmwares), function () {

        ////// 
                  this is where i want to check if controller passing relationship or not if not don;t 
                      show this resource coz i want to have same field that load collection on other 
                      Table . so how to do this
                //////
                return CategoryFirmwareCollection::collection($this->firmwares);
            }),
       ////// 'products': same collection as above check
        ];
    }

as u can see code above i didn't pass any relationship to CategoryResource but how my data show is get all firmware and append it inside "firmware": [{etc.....}]. i have read Doc more than 10 time right now still dunno how it work and how to use it properly.

Thank in advanced!!!

14 Mar
1 year ago

ReakyMark left a reply on React Redux This.props.data.map Is Not Function

@ejdelmonico above solution not work but after i remove {} from object assign it return value as i expected

const newState = Object.assign(...state, action.payload.data);

this result like json from my api
[{
    "id":7,
    "name":"Smart Phone",
    "count_product":25,
    "product":{
        "id":125,
        "name": " V5",
        "image":"v5_01-06-2018-1515204450.jpg",
        "price":"55.00"
    }
  },
  {etc.....}
]

if i add {} back

const newState = Object.assign({}, ...state, action.payload.data);

this result like this

{
 0:{
    "id":7,
    "name":"Smart Phone",
    "count_product":25,
    "product":{
        "id":125,
        "name": " V5",
        "image":"v5_01-06-2018-1515204450.jpg",
        "price":"55.00"
    }
  },
  {etc.....}
}

is this a right solution to remove {} from object assign or ... ?

and another solution is add action.payload.data as object bcoz my data from laravel has remove wrapper

const ProductReducer = (state = {data:[]}, action) => {....});

const newState = Object.assign({}, state, {data: action.payload.data});

  1. which is good way ?

  2. does i shouldn't use Resource::withoutWrapper(); ?

must let it wrap by data for best practice ?

{
  data: [
    {id: 1, .....}m
    etc......
  ]
}

so i don't need to make action.payload.data as {data: action.payload.data} ?

13 Mar
1 year ago

ReakyMark started a new conversation React Redux This.props.data.map Is Not Function

i'm new to redux i had no idea how to fix it i follow other user topic to use redux. final result is this error

this is json from server

[
  {
    "id":7,
    "name":"Smart Phone",
    "count_product":25,
    "product":{
        "id":125,
        "name": " V5",
        "image":"v5_01-06-2018-1515204450.jpg",
        "price":"55.00"
    }
  },
  {etc.....}
]

this is my actions

export default function loadCategory() {
  const request = axios.get('http://domain.com/api/category');
  return {
    type: 'LOAD_CATEGORY',
    payload: request,
  };
}

this is my Reducer

export default function ProductReducer(state = {}, action) {
  const LOAD_CATEGORY = 'LOAD_CATEGORY';
  switch (action.type) {
    case LOAD_CATEGORY:
    
      const newState = Object.assign({}, ...state, action.payload.data)
            console.log(newState); //// result [object, object]
      return newState;
    default:
      return state;
  }
}

this is my index.js

componentWillMount() {
    this.props.loadCategory();
  }
  render() {

const state = this.props.data;
      
     if(state){
      state.map((item) => {
        console.log('newState: ' + item); //// state.map is not function if
    //// if i use  Object.keys(state).map((item) => {
       ////                    console.log('newState: ' + item); /////// it return 0 1 2 3
      ////                 });
      });
      
        return (
        <Text>Hello 
       !</Text>
      )
    } else {
      return (
        <Text>No movies listed</Text>
      );
    }
  }
}

function mapStateToProps(state) {
  return { data: state.data };
}

export default connect(mapStateToProps, { loadCategory })(Product);

Thank in advanced

10 Mar
1 year ago

ReakyMark left a reply on Any1 Using React ? I Had Poblem Undefine But Consone.log() Is Return Value

@Sanctuary yes there is 1 null coz i see default collection is append null when no data so i custom it like default one

public function toArray($request)
    {
        $product = optional($this->product);
        
        if($product->prod_id != null)
        {
            $productNotNull = [
                'name' => $product->prod_name,
                'image' => $product->prod_image
            ];
        }

        return [
            'id'          => $this->fm_id,
            'name'        => $this->fm_name,
            'url'         => $this->fm_url,
            'size'        => $this->fm_size,
            'version'     => $this->fm_version,
            'build'       => $this->fm_build,
            'category_id' => $this->category_id,
            'update_at'   => $this->modify_date,
            'status'      => $this->fm_status,
            'total'       => Firmware::where(['prod_id' => $product->prod_id, 'category_id' => $this->category_id])->count(),
            'product_id'  => $this->prod_id,
            'product'     => $productNotNull ?? null
        ];
    }

after i change my api product from null to '' no more error

'product'     => $productNotNull ?? ''

so if i want to use it in React i can't return null and need to be '' instead for everything ? i thought it same effect but it make make stuck hahaha Thank

ReakyMark left a reply on Any1 Using React ? I Had Poblem Undefine But Consone.log() Is Return Value

@Sanctuary this is console.log i got from ur code above

{data: Array(0)} "
"
Downloads.js:1364 undefined "
"
Downloads.js:1366 [] "
"
Downloads.js:1367 undefined "
"
download:97 

Downloads.js:1363 {data: Array(0)} "
"
Downloads.js:1364 undefined "
"
Downloads.js:1366 [] "
"
Downloads.js:1367 undefined "
"
Downloads.js:1363 {data: Array(18)} "
"
Downloads.js:1364 undefined "
"
Downloads.js:1366 (18) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] "
"
Downloads.js:1367 {id: 108, name: "V5", url: "https://mega.nz/#!BrAFAQSK!sTj_sDEffb72HmOBOcJ_ny0WGawmRh3dpSgqIWejNvo", size: "810 MB", version: "Andriod 5.0", …} "
"

My Component index.jsx

constructor() {
    super();
    this.state = {
      categoryId: null,
      loadFirmware: { data: []  }
    };
  }
categoryClick = (e) => {
    let categoryId = e.currentTarget.getAttribute('data-id');
    axios.post(
      baseUrl + "/api/download/firmware",
      {id: categoryId}
    )
    .then(res => {
      this.setState({
        categoryId: categoryId,
        loadFirmware: res.data
      });
    })
    .catch(error => {console.log(error)});
  }
///////////////////// render()
render() {
    return (
      <React.Fragment>
        <DownloadHeader />

        <DownloadContent
          categoryId={this.state.categoryId}
          clickMore={this.loadMoreFirmware}
          data={this.state.loadFirmware}
        />
        <DownloadModal />
      </React.Fragment>
    );
  }
}

after index.jsx -> DownloadContent.jsx

render() {
    let {props} = this;
    
    return (
      <div className="tab-content">
        <DownloadLogs />
        <DownloadItems {...props}/>
        <DownloadIMEIs />
      </div>
    );
  }
}

next is DownloadItems.jsx code Above.

ReakyMark started a new conversation Any1 Using React ? I Had Poblem Undefine But Consone.log() Is Return Value

my json data from api

{  
   "data":[  
      {  
         "id":117,
         "name":"Smart phone",
         "product_id":125,
         "total":1,
         "product":{  
            "name":"V5",
            "image":"v5_01-06-2018-1515204450.jpg"
         }
      },
      etc.......
      ]
}

my react code

 this.props.data.data.length > 0 &&
     this.props.data.data.map(item => {
          let categoryName = item.name;
          let productName = item.product.name;
          console.log(productName);
         
          etc ........
    }

i had no idea why it error coz when i check in console i see all name from my json there so why it underfine after it the log

Uncaught TypeError: Cannot read property 'name' of null

Thank in advanced.

08 Mar
1 year ago

ReakyMark left a reply on How To Count Relationship And Add Field To Json Data ?

@deansatch how i can return product data specific column i have use eagar loading with select but nothing return

 $json = Category::withCount('countProducts')->with(['countProducts' => 
     function($query){
         $query->select('prod_id', 'prod_name');
     }])->get();

countProducts become empty array.

[{
  "category_id":7,
  "category_name":"Smart Phone"
  ,"count_products_count":8,
  "count_products":[]
 }]

what is problem with my code ?

ReakyMark started a new conversation How To Count Relationship And Add Field To Json Data ?

Mymodel

//Category Model
public function countProducts()
{
     return $this->hasMany(Product::Class, 'category_id', 'category_id');
}

this is my controller call

 $json = Category::with('countProducts')->get();

yes result something like this

[
    {
      "category_id": 7,
      "category_name": "Smart Phone",
      "count_products": [
        {
          "prod_id": 77,
          "prod_name": "Camfone Furious 6S",
        },
etc....
  },
etc....
]

and i want more something like this count Product in each category and add it to category so i can validate it in js without multiple fetch to show or hide.

[
    {
      "category_id": 7,
      "category_name": "Smart Phone",
      "count_products": [
        {
          "prod_id": 77,
          "prod_name": "Camfone Furious 6S",
         
        },
       etc....
       ],
      countItem: 12  /////////////////////////////////////////////////////this is want i want
  },
etc....
]

how can i do that any help ? Thank in advance.

28 Feb
1 year ago

ReakyMark left a reply on Validator Array Data Error Htmlspecialchars() Expects Parameter 1 To Be String

@Snapey Thank for help. i found issue with duplicate input name="" so {{ old('title') ?? $title }} cause error for sure. stuck 2 day now it solve Cheer :D

ReakyMark left a reply on Validator Array Data Error Htmlspecialchars() Expects Parameter 1 To Be String

@Snapey it only say htmlspecialchars() expects parameter 1 to be string etc.. that why i had no idea which line i got error.

ErrorException (E_ERROR)
htmlspecialchars() expects parameter 1 to be string, array given (View: C:\wamp64\www\laravel\resources\views\admin\products\add_edit.blade.php)
C:\wamp64\www\laravel\vendor\laravel\framework\src\Illuminate\Support\helpers.php
        }
 
        die(1);
    }
}
 
if (! function_exists('e')) {
    /**
     * Escape HTML special characters in a string.
     *
     * @param  \Illuminate\Contracts\Support\Htmlable|string  $value
     * @return string
     */
    function e($value)
    {
        if ($value instanceof Htmlable) {
            return $value->toHtml();
        }
 
        return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); ||||||this line is red highlight
    }
}
 
if (! function_exists('ends_with')) {
    /**
     * Determine if a given string ends with a given substring.
     *
     * @param  string  $haystack
     * @param  string|array  $needles
     * @return bool
     */
    function ends_with($haystack, $needles)
    {
        return Str::endsWith($haystack, $needles);
    }
}
 
if (! function_exists('env')) {
    /**
     * Gets the value of an environment variable.
Arguments
"htmlspecialchars() expects parameter 1 to be string, array given (View: C:\wamp64\www\laravel\resources\views\admin\products\add_edit.blade.php)"

that all error

27 Feb
1 year ago

ReakyMark left a reply on Validator Array Data Error Htmlspecialchars() Expects Parameter 1 To Be String

i have title and gallary(image upload) as array my multiple upload work fine except when i do validate.

this is full controller

 $title = $req->input('title');
if($req->hasFile('gallary'))
{
    $prodId = $req->input('product');
    $message = '';
                
    for($i = 0;$i < count($req->gallary); $i++)
    {
        $upload = $req->gallary[$i];
        $setNewFileName = AdminController::setNewFileName($upload, $title[$i]);
        $moveFileTo = $upload->move($path, $setNewFileName);
        if($moveFileTo)
        {
            $data       = [
                'gallary_image' => $setNewFileName,
                'gallary_title' => $title[$i],
                'prod_id'       => $prodId
            ];
            $originName= $upload->getClientOriginalName();
            if (Gallary::create($data)) {
                $message .= "<br>File name {$originName} is uploaded.";          
            }
        else
        {
             $message .= "<br>File name {$originName} not uploaded.";
                                    $fail = true;
        }
    }
   return redirect()->back()->with((isset($fail)) ? 'warning' : 'success', $message);

}

this is my message.blade.php

@if ($errors->any())  
    <?php
        $errorMessage = '';
        $i = 1;
        //var_dump($errors->all());
    ?>
    @foreach ($errors->all() as $error)
       <?php $errorMessage .= $i++.': '.$error.'<br>' ?>
    @endforeach
    {!! $createMessage->make($errorMessage, 'alert-danger') !!}
@endif

@if (Session::get('success') != '')  
    {!! $createMessage->make(Session::get('success'), 'alert-success') !!}
@endif

@if (Session::get('fail') != '')  
    {!! $createMessage->make(Session::get('fail'), 'alert-danger') !!}
@endif

@if (Session::get('warning') != '')  
    {!! $createMessage->make(Session::get('warning'), 'alert-warning') !!}
@endif

this is result of $req->all()

{
    "_token": "uc75zrtKXXAiCiCMHq8bCGeFhv8ZP2w830f3RGcU",
    "product": "126",
    "title": [
        "asd",
        "asdasd"
    ],
    "upload": null,
    "gallary": [
        {},
        {}
    ]
}

i'm not sure how laravel do upload if i need to get File name Size etc. i have to set that index like $req->upload[0] etc for multiple upload.

i don't think it relate to error coz i have remove message.blade.php from my layouts.app and try submit data still got error.can it be problem of how validator check on array value ?

ReakyMark started a new conversation Validator Array Data Error Htmlspecialchars() Expects Parameter 1 To Be String

this is my HTML form

<tr>
    <td>
        <input type="text" name="title[]" value="" class="form-control" placeholder="Enter Title">
    </td>
    <td>
        <input type="file" class="btn-default btn" name="gallary[]" id="galary1"/>
    </td>
    <td>
        <i class="btn btn-danger fa fa-times-circle remove-gallary" aria-hidden="true"></i>
    </td>
</tr>

this is my Validator code

Validator::make(
    $req->all(),
    [
        'title.*' => 'required',
        'gallary.*' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
    ]
)->validate();

if i remove validator code it upload my image and create in DB but if i set Validate like above code i got error with htmlspecialchars() expects parameter 1 to be string.

how to solve it ?

18 Feb
1 year ago

ReakyMark left a reply on Why Validator Only Return Validation.required Not The Message In Res/lang/xx/validator.php ?

@Dunsti aw Thank u solve my problem i just copy Validator.php to my other lang folder now it work:D

ReakyMark started a new conversation Why Validator Only Return Validation.required Not The Message In Res/lang/xx/validator.php ?

this is my code at backend

$validator = Validator::make(
            $req->all(),
            [
                'title'        => 'required',
                'url'          => 'nullable',
                'upload_slide' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
            ]
);

return redirect()->back()
            ->withErrors($validator)
            ->withInput();

this is my code at Frontend

@if ($errors->any())  
    <?php
        $errorMessage = '';
        $i = 1;
        //var_dump($errors->all());
    ?>
    @foreach ($errors->all() as $error )
       <?php $errorMessage .= $i++.': '.$error .'<br>'; ?>
    @endforeach
    {!! $createMessage->make($errorMessage, 'alert-danger') !!}
@endif

code above result in 1: validation.required ....etc what is my problem ?

if i want show message i have to custom it with

$message = [
            'title.required' => 'Please fill Title',
            'url.required' => 'Please fill url',
            'upload_slide.required' => 'Please add image to upload',
            'upload_slide.mimes'    => 'Extension not supported',
            'upload_slide.max'    => 'File is bigger than 2MB'
        ];

code above result in 1: Please fill Title ....etc

15 Feb
1 year ago

ReakyMark left a reply on Need Help Problm Run Laravel On Share Hosting

@bashy do u have any link that guide to setup Laravel Auth at multiple side ?

i'm from CI so not good in modern Laravel yet :D

Thank again.

ReakyMark left a reply on Need Help Problm Run Laravel On Share Hosting

@bashy i wonder how can i move Laravel pre-build Auth to other folder coz i try many time still got error coz i don't wanna edit their core file also route.

like moving from default structure Controller/Auth to Controller/Backend/Auth Right also their resource/view/auth to view/Backend/auth now i use my old CI Auth config PASSWORD_BCRYPT from php recommend and not use pre-build from Laravel coz can't custom it.

last Question is Laravel 5.6 required PHP 7.1.3 can i run it on PHP 7.0 without using New password algorithm Argon2i? coz my hosting not update version php yet so local can be but hosting can't. how to convert old password PASSWORD_BCRYPT from DB to new 7.1.3 Argon2i? or force user to do reset password in order to update password algorithm ?

Thank in advance.

ReakyMark started a new conversation Need Help Problm Run Laravel On Share Hosting

that my folder structure

/root
---/subdomain.domain.com
---/laravel
------------/app
------------/etc...

this is error

[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] #4 /home/user/laravel/vendor/laravel/framework/src/ in /home/user/laravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php on line 122
[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] #3 /home/user/laravel/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler->compile('/home/user/...')
[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] #2 /home/user/laravel/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(121): Illuminate\Filesystem\Filesystem->put('C:\\wamp64\\www\\l...', '<?php $__env->s...')
[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] #1 /home/user/laravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(122): file_put_contents('C:\\wamp64\\www\\l...', '<?php $__env->s...', 0)
[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/home/user/...', 122, Array)
[Thu Feb 15 06:54:06 2018] [error] [client 114.134.184.33] PHP Fatal error:  Uncaught ErrorException: file_put_contents(C:\wamp64\www\laravel\storage\framework\views/7a5bb53c9e934c38689bbd713ac6636aff817ebf.php): failed to open stream: No such file or directory in /home/user/laravel/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122

how to solve this ?

Sorry i fix the issue by remove config in cache folder bcoz it dump my wamp config so it error like this. First time run it on real hosting :D

23 Jan
1 year ago

ReakyMark left a reply on Why Session Expire In Next Request ?

@satiseven777 i test it with laravel debuggar when next request session('lang') set to _kh not empty that english must be present in next request