Im try to insert data to a table in php my admin using vue.js laravel and axiom, why is it not working im getting error 404 when posting
i tried looking up tutorials but nothing helps. perhaps i have to create a table yousing laravel in order for the route to work? any ideas would be apreciated
my code
app.vue:
i seem to be using axtion properly but maybe the route must be diffrent?
<template>
<div class="container mt-5">
<div class="row">
<div class="col-8 form-section">
<h4 class="mb-3">List of employee</h4>
<table class="table">
<caption>
List of employee
</caption>
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Phone</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Naran code</td>
<td>example#gmail.com</td>
<td>1234567890</td>
<td>
<span class="mr-2">
<font-awesome-icon icon="trash-alt" :style="{ color: 'red' }" />
</span>
<span>
<font-awesome-icon :icon="['fas', 'user-edit']" />
</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-4">
<form #submit.prevent="saveData()">
<div class="form-row form-section">
<h4 class="mb-3">Add Employee Info</h4>
<div class="col-12 mb-3">
<label
class="form-label form-label-top"
for="firstName"
>First Name
<span class="form-required">*</span>
</label>
<input
type="text"
class="form-control"
v-model="employee.vardas"
placeholder="First Name"
/>
</div>
<button class="btn btn-primary" type="submit">
SUBMIT
</button>
</div>
</form>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
'employee': {
'vardas':''
}
};
},
methods: {
saveData() {
axios.post('/employee/create', this.employee).then(
response => {
console.log(response);
}
). catch(error => {
console.log('Error here');
})
}
}
};
</script>
<style scope>
.form-label-top {
width: 100%;
margin-left: 2px;
margin-bottom: 10px;
}
.form-label {
color: #2c3345;
display: inline-block;
font-size: 16px;
font-weight: 500;
word-break: break-word;
}
.form-required {
color: #f23a3c;
}
.form-section {
border-radius: 10px;
overflow: hidden;
padding: 62px 55px 65px;
box-shadow: 0 3px 20px 0 rgb(0 0 0 / 10%);
-moz-box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 3px 20px 0 rgb(0 0 0 / 10%);
-o-box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.1);
-ms-box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.1);
}
input.form-control {
height: 44px;
}
tbody,
td,
tfoot,
th,
thead,
tr {
line-height: 48px;
}
.mr-2 {
margin-right: 10px;
}
</style>```
Models/empLoyee.php
------------------------------------------------------------
```<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Employee extends Model
{
use HasFactory;
protected $fillable=[
'vardas'
];
}
App\Http\Controllers\EmployeeController
<?php
namespace App\Http\Controllers;
use App\Models\Employee;
use Illuminate\Http\Request;
class EmployeeController extends Controller
{
/**
* Display a listing of the resource.
*
* #return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* #return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* #param \Illuminate\Http\Request $request
* #return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$data = $request ->all();
$response = Employee::create($data);
return response()->json([
'status' => 'viskas pavyko',
'data' => $response
], 200);
}
/**
* Display the specified resource.
*
* #param \App\Models\Employee $employee
* #return \Illuminate\Http\Response
*/
public function show(Employee $employee)
{
//
}
/**
* Show the form for editing the specified resource.
*
* #param \App\Models\Employee $employee
* #return \Illuminate\Http\Response
*/
public function edit(Employee $employee)
{
//
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param \App\Models\Employee $employee
* #return \Illuminate\Http\Response
*/
public function update(Request $request, Employee $employee)
{
//
}
/**
* Remove the specified resource from storage.
*
* #param \App\Models\Employee $employee
* #return \Illuminate\Http\Response
*/
public function destroy(Employee $employee)
{
//
}
}```
Web.php:
--------------------------------------------------------------------
```<?php
use App\Http\Controllers\EmployeeController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::post('/employee/create', [EmployeeController::class, 'store']);```
im stuck i keep getting 404 error whit getting this message POST http://localhost:5173/employee/create 404 (Not Found) can anyone help me im new to laravel and this routing is confusing this is driving me crazy pls help ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- hfdhdfhdfhfdhfdhdfhdfhdfhdfhdf help help help help help help help help help help help help help help help help help help help help help help help help p help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help help p help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help help p help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help helpp help help help help help help help help help help help help
Related
Thanks for reading! Probably a very dumb question.. But i've searched here and haven not found an answer.. So if anyone could please help me..
I work with adsense on my wix blog. Only thing i needed was to display ADVERTISEMENTS written on the top of the ad. I don't know what to add in the adsense code to make it appear. Only whing i could do was make the ad display aligned center. This is how one code looks!
<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6224129687174030"
crossorigin="anonymous"></script>
<!-- MobileTopDesktop&Post / Desktop&MobileMiddle of Post (300x250) -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-6224129687174030"
data-ad-slot="4506401193"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
I don't know whether i could put advertisement on top of the ad and maybe something to distinguise the whole ad like a background.
I'm here to learn. Thanks a million!
PS.: the backgroud of the website is BLACK
I have a problem. I would like set rel="nofollow" Links in my summernote editor.
I tried to rng.insertNode($('' + sLinkText + '')[0]); on line 1757 but it doesn't work.
Can someone help me please?
THX
In this fiddle, the tool tips are not working. Does anyone know why?
http://jsfiddle.net/yDk6z/1/
nv.models.scatterPlusLineChart();
...
Please include the following JS in your project.
http://cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.v3.min.js
<h2>Promises not kept NOTHING CHNAGED HERE</h2>
<div id="chart" class="with-3d-shadow with-transitions">
<svg></svg>
</div>
DEMO LINK
I am using the RokSprocket module in a Joomla Template and I would need to open one photo by link in a different windows, for it, Could anybody help me?
Thanks in advance
Best Regards
Alejandro Castan
PS: Sorry for my little english
<!DOCTYPE html><html><head><script>var w;function openwindow(){w=window.open('http://www.w3schools.com/','', 'width=100,height=100');w.focus();}function myFunction(){w.resizeTo(500,500);w.focus();}</script></head><body><button onclick="openwindow()">Create window</button><button onclick="myFunction()">Resize window</button></body></html>
I have uses the following to solve my problem:
<a href="/extensions/roksprocket/13-roksprocket-features/25-sample-content-1" target="_blank">
<img src="/extensions/media/rokgallery/f/faa025be-fad2-4f7b-f7bc-2e3e9ad367a1/69f8dbe1-9a16-42d1-8ee7-ca0aa2be7992.jpg" alt="" style="max-width: 100%; height: auto;">
</a>
I have this error message coming up after I have deployed DataTables inside of my application. I cannot see where this would be coming from as I haven't declared anything in my JS that would cause it. All the tables have got unique names and so do my divs. I have found this which was the same issue but his workaround doesn't seem to apply to my problem:
http://www.datatables.net/forums/discussion/7668/datatables-warning-attempted-to-initialise-datatables-on-a-node-which-is-not-a-table-div/p1
Anyone have any pointers? Google doesn't seem to be able to help so looking at you guys for assistance.
Cheers
Nick
UPDATE:
This is still causing me an issue. could anyone assist or point in the right direction?
You are probably using an id on the datatable whereas you are also declaring another item in the same page with the same id.
I had the same problem:
I had this in my code:
<div class="modal fade span3 ui-corner-all" id="cheques" style="display: none">
and I also had
<table class="table table-nomargin dataTable table-bordered" id="cheques">
I renamed on of the element's id and it worked ;)