skip to Main Content

Laravel errors while storing a file

I am working on a laravel crud project. Now i want to store files like .xlsx and .docx But i keep getting errors in my controller and browser: Controller: public function store(Request $request) { $request->validate([ 'title'=>'required', 'description_short'=>'', 'description_long'=>'', 'file'=>'', 'language_id'=>…

VIEW QUESTION

Laravel get value from another table based on id

I want to get department_name from department table with table department = id, department_name, total_employee table employee = id, employee_name, id_department, email, telephone, gender, status I tried model.Employee public function department() { return $this->belongsTo(Department::class); } controllers.EmployeeControllers public function index() {…

VIEW QUESTION

Pass if statement outcome to blade – Laravel

Trying to access from Controller values to my blade public function show(Template $template){ if (Save::where('user_id', '=', auth()->user()->id)->count() > 0) { if (Save::where('title', '=', $template->title)->count() > 0) { //OUTPUT - EXISTS } //OUTPUT - NOT EXISTS } return view('actions/show', [ 'template'…

VIEW QUESTION

In Laravel controller file, I would like to change the date format of regDate from 'Y-m-d' to 'd/m/Y'. RegDate from table is in YYYY-mm-dd

I would like to format "regDate" to 'dd/mm/YYYY' from 'YYYY/mm/dd'. Appreciate any help. Thanks. if ($request->keyword != "") { $students = Student::where ("name","LIKE","%" . $request->keyword . "%") ->orWhere("nric","LIKE","%" . $request->keyword . "%") ->orWhere("address","LIKE","%" . $request->keyword . "%") ->orWhere("telNo","LIKE","%" . $request->keyword…

VIEW QUESTION
Back To Top
Search